note 7002 deleted from function.include by philip

From: Date: Fri, 02 Nov 2001 06:50:15 +0000
Subject: note 7002 deleted from function.include by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-20272@lists.php.net to get a copy of this message
Because require statements are replaced with the contents of the included file, the following construct does not work:<P> if (defined("MYSOURCE_PHP")) { return; } define("MYSOURCE_PHP",1);<P> If the file is being required for the second time, the calling script returns at this point, and no further code is executed. To get around this, I used:<P> if (!defined("MYSOURCE_PHP)) { define("MYSOURCE_PHP",1); /* function definitions */ }<P> This seems to resolve the issue for me using 4.0.1pl2.

« previous php.notes (#20272) next »