note 109705 added to language.pseudo-types
| From: | mike at EastGhostCom | Date: | Mon, 13 Aug 2012 05:50:40 +0000 |
| Subject: | note 109705 added to language.pseudo-types | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190044@lists.php.net to get a copy of this message | ||
If you pass a string as the callback function (i.e., 2nd parm to preg_replace_callback()), then PHP
will interpret it as a function's name in the current scope -- and Main::dada_cb is not a valid
function name in any scope.
If you want to specify a static method of a class as the callback (i.e., "Main::dada_cb"),
then you must pass as 2nd parm to preg_replace_callback:
array( 'Main', 'dada_cb')
And, if you want to use as a callback some method of an instantiated object (i.e.,
$object->dada_cb), then you must pass as the 2nd parm to preg_replace_callback:
array( $object, 'dada_cb' )
----
Server IP: 69.147.83.197
Probable Submitter: 70.91.82.193
----
Manual Page -- http://www.php.net/manual/en/language.pseudo-types.php
Edit -- https://master.php.net/note/edit/109705
Del: integrated -- https://master.php.net/note/delete/109705/integrated
Del: useless -- https://master.php.net/note/delete/109705/useless
Del: bad code -- https://master.php.net/note/delete/109705/bad+code
Del: spam -- https://master.php.net/note/delete/109705/spam
Del: non-english -- https://master.php.net/note/delete/109705/non-english
Del: in docs -- https://master.php.net/note/delete/109705/in+docs
Del: other reasons-- https://master.php.net/note/delete/109705
Reject -- https://master.php.net/note/reject/109705
Search -- https://master.php.net/manage/user-notes.php