From:             ganswijk at xs4all dot nl
Operating system: irrelevant
PHP version:      5.3CVS-2008-08-25 (CVS)
PHP Bug Type:     Feature/Change Request
Bug description:  wanted: eval() that works in a separate variable space

Description:
------------
I'd like a version of eval() that works in a separate environment
(variable namespace) so it can't clutter up the main script. Probably it's
best to give the name of an environment for example an object/array name as
a second argument to eval(), so the programmer can decide if two successive
calls of eval should work on the same or separate environments. There is
probably no problem with the main program having access to the namespaces
of the eval() calls.

For example (assuming that the separate environment is just an
object/array in the main program):

$a=1;

eval('$a=2;',$environment1);

echo $a;  //shows 1

echo $environment1.a;  //shows 2

eval('echo $a;',$environment1);  //shows 2
eval('echo $a;',$environment2);  //shows nothing or undefined



-- 
Edit bug report at http://bugs.php.net/?id=45912&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45912&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45912&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45912&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45912&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45912&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45912&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45912&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45912&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45912&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45912&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45912&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45912&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45912&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45912&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45912&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45912&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45912&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45912&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45912&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45912&r=mysqlcfg

Reply via email to