note 60260 added to function.create-function
| From: | boards at gmail dot com | Date: | Sat, 31 Dec 2005 19:18:17 +0000 |
| Subject: | note 60260 added to function.create-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101057@lists.php.net to get a copy of this message | ||
If you were checking to see if a function is made properly, this would be a better way of checking:
<?php
$fnc = @create_function('$arg1,$arg2,$arg3', 'return true;');
# make that function whatever you want
if (empty($fnc)) {
die('Could not create function $fnc.');
}
# although, the follow will NOT work
if (empty(create_function('$arg', 'return $arg;'))) {
die('Could not create anonymous function.');
}
# you would get an error regarding not being able to use a
# return value in writeable context (i.e. a return value is
# a const in C, and the function empty() doesn't use a
# const void* parameter
?>
----
Manual Page -- http://www.php.net/manual/en/function.create-function.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60260
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60260&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60260&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60260&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60260&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60260&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60260&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60260&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60260&report=yes
Search -- http://master.php.net/manage/user-notes.php