note 12314 modified in functions by sander

From: Date: Sun, 21 Apr 2002 18:48:46 +0000
Subject: note 12314 modified in functions by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-29649@lists.php.net to get a copy of this message
[Editor's note: put your includes in the beginning of your script. You can call an included function, after it has been included --jeroen] The documentation states: "In PHP 3, functions must be defined before they are referenced. No such requirement exists in PHP 4." I thought it wise to note here that there is in fact a limitation: you cannot bury your function in an include() or require(). If the function is in an include()'d file, there is NO way to call that function beforehand. The workaround is to put the function directly in the file that calls the function. --was-- [Editor's note: put your includes in the beginning of your script. You can call an included function, after it has been included --jeroen] <p>The documentation states: "In PHP 3, functions must be defined before they are referenced. No such requirement exists in PHP 4."</p> <p>I thought it wise to note here that there is in fact a limitation: you cannot bury your function in an include() or require(). If the function is in an include()'d file, there is NO way to call that function beforehand. The workaround is to put the function directly in the file that calls the function.</p> http://www.php.net/manual/en/functions.php

« previous php.notes (#29649) next »