note 85391 added to function.create-function
| From: | neo at nowhere dot com | Date: | Thu, 28 Aug 2008 08:56:57 +0000 |
| Subject: | note 85391 added to function.create-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143910@lists.php.net to get a copy of this message | ||
In response to kkaiser at revolution-records dot net's note, even tho PHP will allow you to use
<?
$myfunc = create_function('$this', $code);
?>
You can NOT use a reference to "$this" inside of the anonymous function, as PHP will
complain that you are using a reference to "$this" in a non-object context.
Currently, I have not found a work-around for this...
----
Server IP: 209.41.74.194
Probable Submitter: 68.184.206.170
----
Manual Page -- http://www.php.net/manual/en/function.create-function.php
Edit -- https://master.php.net/note/edit/85391
Del: integrated -- https://master.php.net/note/delete/85391/integrated
Del: useless -- https://master.php.net/note/delete/85391/useless
Del: bad code -- https://master.php.net/note/delete/85391/bad+code
Del: spam -- https://master.php.net/note/delete/85391/spam
Del: non-english -- https://master.php.net/note/delete/85391/non-english
Del: in docs -- https://master.php.net/note/delete/85391/in+docs
Del: other reasons-- https://master.php.net/note/delete/85391
Reject -- https://master.php.net/note/reject/85391
Search -- https://master.php.net/manage/user-notes.php