note 117916 added to function.function-exists
| From: | michael at squiloople dot com | Date: | Tue, 01 Sep 2015 08:28:24 +0000 |
| Subject: | note 117916 added to function.function-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203552@lists.php.net to get a copy of this message | ||
It should be noted that the function_exists check is not relative to the root namespace. This means
that the namespace should be appended to the check:
<?php
namespace test;
if (!function_exists(__NAMESPACE__ . '\example'))
{
function example()
{
}
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 81.137.222.150
----
Manual Page -- http://php.net/manual/en/function.function-exists.php
Edit -- https://master.php.net/note/edit/117916
Del: integrated -- https://master.php.net/note/delete/117916/integrated
Del: useless -- https://master.php.net/note/delete/117916/useless
Del: bad code -- https://master.php.net/note/delete/117916/bad+code
Del: spam -- https://master.php.net/note/delete/117916/spam
Del: non-english -- https://master.php.net/note/delete/117916/non-english
Del: in docs -- https://master.php.net/note/delete/117916/in+docs
Del: other reasons-- https://master.php.net/note/delete/117916
Reject -- https://master.php.net/note/reject/117916
Search -- https://master.php.net/manage/user-notes.php