note 115737 added to functions.user-defined
| From: | php at xenhideout dot nl | Date: | Mon, 15 Sep 2014 17:59:31 +0000 |
| Subject: | note 115737 added to functions.user-defined | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200450@lists.php.net to get a copy of this message | ||
Please be advised that the code block defining the function, within the function_exists() call, has
to be executed for the function to get defined, whereas this is not the case for regular, unenclosed
functions.
Meaning, if you write code like this:
<?php
do_function();
if (!function_exists('my_undefined')) {
function my_undefined() {
}
}
function do_function() {
my_undefined();
}
?>
..Then my_undefined will not be defined before the code in do_function calls it. Some people put
their function sections below the regular executing code of the script. Making any of it
'pluggable' can then cause problems.
----
Server IP: 72.52.91.14
Probable Submitter: 77.249.176.227
----
Manual Page -- http://php.net/manual/en/functions.user-defined.php
Edit -- https://master.php.net/note/edit/115737
Del: integrated -- https://master.php.net/note/delete/115737/integrated
Del: useless -- https://master.php.net/note/delete/115737/useless
Del: bad code -- https://master.php.net/note/delete/115737/bad+code
Del: spam -- https://master.php.net/note/delete/115737/spam
Del: non-english -- https://master.php.net/note/delete/115737/non-english
Del: in docs -- https://master.php.net/note/delete/115737/in+docs
Del: other reasons-- https://master.php.net/note/delete/115737
Reject -- https://master.php.net/note/reject/115737
Search -- https://master.php.net/manage/user-notes.php