note 51534 added to language.functions
| From: | riseofthethorax at earthlink dot net | Date: | Sun, 03 Apr 2005 01:49:28 +0000 |
| Subject: | note 51534 added to language.functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87383@lists.php.net to get a copy of this message | ||
I know functions can't be undefined, now..
But how about this..
Include a file, the file defines a variable called
"$function_name".. $function_name contains
the name of the actual function.. The actual function_name
is either created insitu or when the include file was created.
The actual function name, in any case, has a random string
associated with it (20 character alphanumeric?)..
The file including this function, could somehow dynamically
call the function using the $function_name variable..
Since the actual function name is some name plus a random string, it produces a kind of virtual
scope (or a statically improbable conflict). Then you could call the same function multiples of
times in the process of a script, and not have to worry about function name clashes.. Of course this
is a memory leak in the making, but it allows one to essentially call similar named functions in the
current state of PHP configuration..
----
Manual Page -- http://www.php.net/manual/en/language.functions.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51534
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51534&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51534&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51534&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51534&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51534&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51534&report=yes
Search -- http://master.php.net/manage/user-notes.php