From: jonas dot info at gmx dot net Operating system: Win32; all? PHP version: 4.3.3 PHP Bug Type: Feature/Change Request Bug description: virtual() behaviour for php-files
Description: ------------ i have tested the virtual("file2.php"); feature in php 4.3.3. now it behaves like an include in every way. but i think it would be better to parse the script as there were no calling script, so it were called through apache, so that the variable $test would not be changed in the called script and the $_SERVER["PHP_SELF"] has to be the called script, not the calling. so it would be good to add a new parameter to virtual() to set some ini options for the called script (espacially the "open_basedir" and "safe_mode" options, or in the apache per directory settings of the called script) to allow customers to add there own php scripts in a kind of more controlled environement. Reproduce code: --------------- <!-- called.php --> <?php echo("this is: " . $_SERVER["PHP_SELF"] . "<br>"); $test = "variable has changed"; ?> <!-- per_include.php --> include:<br> <?php $test = "variable set"; include("called.php"); echo($test); ?> <!-- per_virtual.php --> virtual:<br> <?php $test = "variable set"; virtual("called.php"); echo($test); ?> Expected result: ---------------- include: this is: /path/per_include.php variable has changed virtual: this is: /path/called.php variable set Actual result: -------------- include: this is: /path/per_include.php variable has changed virtual: this is: /path/per_virtual.php variable has changed -- Edit bug report at http://bugs.php.net/?id=25437&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25437&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25437&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25437&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25437&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25437&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25437&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25437&r=support Expected behavior: http://bugs.php.net/fix.php?id=25437&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25437&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25437&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25437&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25437&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25437&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25437&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25437&r=gnused