note 25693 deleted from function.create-function by victor
| From: | victor@php.net | Date: | Fri, 04 Oct 2002 10:38:39 +0000 |
| Subject: | note 25693 deleted from function.create-function by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37659@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.