note 40611 added to function.create-function
| From: | MagicalTuxatFF dot ST at rn2 dot php dot net | Date: | Tue, 09 Mar 2004 15:25:09 +0000 |
| Subject: | note 40611 added to function.create-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66506@lists.php.net to get a copy of this message | ||
neo at gothic-chat d0t de wrote :
Beware of memory-leaks, the garbage-collection seems to 'oversee' dynamically created
functions!
Not really...
In fact, PHP can not "unassign" functions. So if you create a function, it won't be
deleted until the end of the script, even if you unset the variable containing its name.
If you need to change a part of a function everytime you run a loop, think of a way to make a more
general function or try using eval :) (functions are made to be re-used. If you need to run your own
piece of code once, eval is much better).
----
Manual Page -- http://www.php.net/manual/en/function.create-function.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40611
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40611&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40611&report=yes
Search -- http://master.php.net/manage/user-notes.php