Bug #14164: variables set in remotely include()d file are lost upon return
| From: | steve at petabit dot com | Date: | Wed, 21 Nov 2001 19:35:43 +0000 |
| Subject: | Bug #14164: variables set in remotely include()d file are lost upon return | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-71294@lists.php.net to get a copy of this message | ||
From: steve@petabit.com
Operating system: Linux
PHP version: 4.0.5
PHP Bug Type: Scripting Engine problem
Bug description: variables set in remotely include()d file are lost upon return
When using http to include() or require() a file,
the variables set within are lost when returning
to the calling file.
Behavior is instead as expected when included or required file is local.
Example:
<?php
echo phpversion();
echo "<br>try include<br>\n";
$test1 = "foo";
echo "test1 = $test1";
echo "<br>now including change of test1<br>";
include("http://192.168.100.3/includechild.php");
echo "<br>outside: test1 = $test1";
echo "<br>result: $result";
echo "<br>now try require<br>\n";
$test2 = "foo";
echo "test2 = $test2";
echo "<br>now requiring change of test2<br>";
require("http://192.168.100.3/requirechild.php");
echo "<br>outside: test2 = $test2";
?>
includechild.php: (and similar to requirechild.php)
-----------------
<?php
$test1 = "bar";
echo "Inside: test1 = $test1";
?>
Results:
-----------
4.0.5
try include
test1 = foo
now including change of test1
Inside: test1 = bar
outside: test1 = foo
now try require
test2 = foo
now requiring change of test2
Inside: test2 = bar
outside: test2 = foo
--
Edit bug report at: http://bugs.php.net/?id=14164&edit=1