note 77177 added to function.create-function
| From: | TSE-WebDesign at osu1 dot php dot net | Date: | Sat, 18 Aug 2007 16:55:57 +0000 |
| Subject: | note 77177 added to function.create-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129575@lists.php.net to get a copy of this message | ||
Here's how to call a runtime-created function from another runtime-created function:
<?php
$get_func = create_function('$func', 'return substr($func,1);');
$get_value = create_function('$index','return pow($index,$index);');
$another_func = create_function('$a',
'$func="\x00"."'.$get_func($get_value).'";return
$func($a);');
echo $another_func(2); # result is 4
?>
----
Server IP: 87.238.162.147
Probable Submitter: 84.196.194.200
----
Manual Page -- http://www.php.net/manual/en/function.create-function.php
Edit -- https://master.php.net/note/edit/77177
Del: integrated -- https://master.php.net/note/delete/77177/integrated
Del: useless -- https://master.php.net/note/delete/77177/useless
Del: bad code -- https://master.php.net/note/delete/77177/bad+code
Del: spam -- https://master.php.net/note/delete/77177/spam
Del: non-english -- https://master.php.net/note/delete/77177/non-english
Del: in docs -- https://master.php.net/note/delete/77177/in+docs
Del: other reasons-- https://master.php.net/note/delete/77177
Reject -- https://master.php.net/note/reject/77177
Search -- https://master.php.net/manage/user-notes.php