note 93742 added to function.require-once
| From: | smith at helpme dot com | Date: | Fri, 25 Sep 2009 09:54:59 +0000 |
| Subject: | note 93742 added to function.require-once | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161044@lists.php.net to get a copy of this message | ||
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?
----
Server IP: 208.69.120.35
Probable Submitter: 68.51.49.83
----
Manual Page -- http://www.php.net/manual/en/function.require-once.php
Edit -- https://master.php.net/note/edit/93742
Del: integrated -- https://master.php.net/note/delete/93742/integrated
Del: useless -- https://master.php.net/note/delete/93742/useless
Del: bad code -- https://master.php.net/note/delete/93742/bad+code
Del: spam -- https://master.php.net/note/delete/93742/spam
Del: non-english -- https://master.php.net/note/delete/93742/non-english
Del: in docs -- https://master.php.net/note/delete/93742/in+docs
Del: other reasons-- https://master.php.net/note/delete/93742
Reject -- https://master.php.net/note/reject/93742
Search -- https://master.php.net/manage/user-notes.php