Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15424447
D21541.id51275.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
830 B
Referenced Files
None
Subscribers
None
D21541.id51275.diff
View Options
diff --git a/src/xsprintf/xsprintf.php b/src/xsprintf/xsprintf.php
--- a/src/xsprintf/xsprintf.php
+++ b/src/xsprintf/xsprintf.php
@@ -67,6 +67,18 @@
}
if ($callback !== null) {
+
+ // See T13588 and D21500. This function uses "$callback()", instead
+ // of "call_user_func()", to simplify reference behavior: some of
+ // these arguments must be passed by reference.
+
+ // Prior to PHP7, this syntax will not work if "$callback" is a
+ // string referencing a static method, like "C::m".
+
+ // This syntax does work if "$callback" is an array referencing
+ // a static method, like "array('C', 'm')", in all versions of PHP
+ // since PHP 5.4.
+
$callback($userdata, $pattern, $pos, $argv[$arg], $len);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 23, 10:28 PM (1 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7657684
Default Alt Text
D21541.id51275.diff (830 B)
Attached To
Mode
D21541: Annotate the unusual use of "$callback()" in "xsprintf()"
Attached
Detach File
Event Timeline
Log In to Comment