[Sync EN] Major rewrite of the callable type chapter#250
Open
lacatoire wants to merge 1 commit into
Open
Conversation
Brings language/types/callable.xml up to date with the upstream rewrite (EN-Revision 312c0c7b39d0722c419f6784cbda24823220dfb3): - Title "Callbacks / Callables" → "Callables". - New intro paragraph with a short informalexample showing callable as a parameter type. - Section "Übergabe" renamed to "Erstellung von Callables" and reorganized around how callables are created. - New itemizedlist enumerating the four ways to create a callable (Closure object, string, array with class+method, object implementing __invoke). - New explanation of how Closure objects can be built (anonymous function, arrow function, first-class callable syntax, Closure::fromCallable) with a runnable example showing all four. - New note about scope binding (Closure is bound to creation scope, callables as string/array are resolved in the call scope). - New paragraph and note about context-dependent callables (parent::method, ["static", "method"]) deprecated since PHP 8.2.0. - Existing call_user_func example expanded with a new Type 5 case using MyClass::class and renumbered subsequent types; output is now shown via a <screen> block. - Standalone Closure example removed (content merged into the new Closure example earlier in the section). - Dropped the obsolete <!-- $Revision$ --> SVN marker. Sie-Form beibehalten, bestehender Maintainer (simp) bleibt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bringt
language/types/callable.xmlauf den Stand von upstream doc-en (312c0c7b39). Die englische Seite wurde grundlegend umgeschrieben.Änderungen:
Callbacks / Callables→Callables.<informalexample>, dascallableals Parametertyp zeigt.Übergabe→Erstellung von Callables, Inhalte um die Erstellungsarten herum reorganisiert.<itemizedlist>mit den vier Erstellungsarten (Closure-Objekt, String mit Funktions- oder Methodennamen, Array mit Klasse+Methode, Objekt mit__invoke).Closure-Objekten (anonyme Funktion, Pfeilfunktion, First-Class-Callable-Syntax,Closure::fromCallable) mit einem lauffähigen Beispiel.Closureist an den Erstellungs-Scope gebunden; String/Array-Callables werden im Aufruf-Scope aufgelöst).parent::method,["static", "method"]) und deren Verwerfung seit PHP 8.2.0.call_user_func-Beispiel wurde um den neuen Typ 5 (MyClass::class) erweitert; nachfolgende Typen neu nummeriert; Ausgabe nun über einen<screen>-Block.Closure-Beispiel wurde entfernt (Inhalt im neuen Closure-Beispiel weiter oben aufgegangen).<!-- $Revision$ -->-SVN-Marker entfernt.Die "Sie"-Form wurde durchgehend beibehalten, bestehender
Maintainer:(simp) bleibt.