note 93742 deleted from function.require-once by danbrown
| From: | danbrown@php.net | Date: | Fri, 25 Sep 2009 17:10:58 +0000 |
| Subject: | note 93742 deleted from function.require-once by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161056@lists.php.net to get a copy of this message | ||
Note Submitter: smith at helpme dot com
----
I'm having a mindblowing problem I'm hoping someone can help me with.
I'm trying to minimize the amount of code being loaded by breaking parts of it off into scripts
and calling it up when it's needed using a method like this...
if($mycondition == 1)
{
require_once("myphpscript.php");
}
The problem I'm having is that the code in myphpscript.php is being executed even when I try to
force it out using...
if(2 == 1)
{
require_once("myphpscript.php");
}
So I'm forced to conclude that PHP thinks 2 == 1(not likely) or that require_once means
REQUIRE_ONCE and it doesn't care about the condition period. Anyone else have this problem or
know a way around it?