Description
The following code:
online repro: https://3v4l.org/A5kUZ
bugs.php.net issue: https://bugs.php.net/bug.php?id=64346
<?php
namespace X;
eval('function c() { var_dump("global"); }');
function foo() {
c();
}
function foo2() {
c();
}
foo();
eval('namespace X; function c() { var_dump("namespaced"); }');
foo();
foo2();
Resulted in this output:
string(6) "global"
string(6) "global"
string(10) "namespaced"
But I expected this output instead:
string(6) "global"
string(10) "namespaced"
string(10) "namespaced"
PHP Version
since PHP 5.4
Operating System
any probably