ID: 31888
User updated by: quinn at quinn dot student dot utwente dot nl
Reported By: quinn at quinn dot student dot utwente dot nl
-Status: Open
+Status: Closed
Bug Type: *General Issues
Operating System: Linux Gentoo 2.4.28
PHP Version: 5.0.3
New Comment:
Closed
Previous Comments:
------------------------------------------------------------------------
[2005-02-08 21:44:56] quinn at quinn dot student dot utwente dot nl
Sorry to have bothered anyone with this :( i forgot the scope i should
have returned the value in the eval.
like:
eval("return text();");
------------------------------------------------------------------------
[2005-02-08 21:20:26] quinn at quinn dot student dot utwente dot nl
Description:
------------
According to the documentation a return in eval should return the value
passed to the return statement.
This works fine outside functions or classes. But when you want to eval
a function or a function in a class this does not work.
Reproduce code:
---------------
class aap{
static function aap1(){
return 'aap';
}
}
function text(){
return 'text';
}
$a = eval('text();');
echo $a;
$b = eval("return 'output';");
echo $b;
$c = eval("aap::aap1();");
echo $c;
Expected result:
----------------
text output aap
Actual result:
--------------
output
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31888&edit=1