note 25693 added to function.create-function

From: Date: Wed, 02 Oct 2002 14:26:00 +0000
Subject: note 25693 added to function.create-function
Groups: php.notes 
Request: Send a blank email to php-notes+get-37546@lists.php.net to get a copy of this message
After hours of trying i was unable to do a couple of things with create_function that i initally hoped for. First globals don't work. Even in this simple script: <?php $test = "test"; $this = create_function('', 'global $test; print $test;'); $test; ?> and that prints nothing. Also when attempting to insert this inside of a class, i was hoping that the class variables would be included, but they aren't. Even if i could just globalize $this in there... When i try returning a variable from a lamada function, it'll return "lamada_function(...my returned value...)". When isn't good for me. Not sure if this is a desired usage. Don't get my wrong, i found this incredibly useful on several occasions like my html filter which uses a reference as an argument in a create_function and saves space. -- http://www.php.net/manual/en/function.create-function.php http://master.php.net/manage/user-notes.php?action=edit+25693 http://master.php.net/manage/user-notes.php?action=delete+25693 http://master.php.net/manage/user-notes.php?action=reject+25693

« previous php.notes (#37546) next »