note 28821 deleted from function.require by sniper
| From: | sniper@php.net | Date: | Wed, 29 Jan 2003 04:28:55 +0000 |
| Subject: | note 28821 deleted from function.require by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43003@lists.php.net to get a copy of this message | ||
A BIG ATTENTION!
let`s say that we have this 2 files include.php & test.php:
include.php
<?
$foo="blabla";
?>
and now test.php:
<?
require "include.php";
function do_test()
{
if ($foo) {echo "foo is set if called from function<br>";} else {echo "bang foo
is not set if called from function<br>";}
}
do_test();
if ($foo) {echo "foo is set if called from main<br>";} else {echo "bang foo is
not set if called from main<br>";}
Result of the program is:
bang foo is not set if called from function.
foo is set if called from main
Bug?
Server: Apache/1.3.26 (Win32) PHP/4.2.3