require behaviour
| From: | Stefano Bagnara | Date: | Fri, 17 Dec 1999 14:08:43 +0000 |
| Subject: | require behaviour | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-8041@lists.php.net to get a copy of this message | ||
i got 2 files: a.php and b.php
a.php
<?
$A = 1;
function test() {
require (b.php);
}
test();
print($A);
?>
b.php
<?
$A = 2;
function testb() {
.....
}
?>
is it right that it prints 1?? and, if so, why in b.php the $A is not global
but the function declaration still works?
is there a workaround?