note 49183 added to function.function-exists
| From: | tommy at NOSPAM dot van-tomas dot de | Date: | Wed, 19 Jan 2005 09:01:15 +0000 |
| Subject: | note 49183 added to function.function-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-83612@lists.php.net to get a copy of this message | ||
Why this function doesn't return true while checking the function empty()?
e.g.
<?php
$sFunctionname = "empty";
if (function_exists("$sFunctionname")) {
echo "Function $sFunctionname() was found!";
} else {
echo "Function $sFunctionname() couldn't be found!";
}
?>
returns "Function empty() couldn't be found!"
I've discussed this with a co-worker and he mentioned, that function_exists() maybe watches in
a "function list" for functions, that were not part of the php distribution from the
beginning. But I've tested this with the mail() function, which is part of PHP since version 3,
and it returned true! Isn't the empty() function a function?
----
Manual Page -- http://www.php.net/manual/en/function.function-exists.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49183
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49183&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49183&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49183&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49183&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49183&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49183&report=yes
Search -- http://master.php.net/manage/user-notes.php