php - Is it a bug that 'assert' ignores the current namespace? -
should following problem considered normal behavior or bug?
<?php namespace ns; function func () { echo "hello\n"; return true; } func(); // ok assert('func()'); // "call undefined function func()"
assert assume behaving same way eval in switches execution global namespace when code passed evaluated. specifying namespace in call works expect:
<?php namespace ns; function func () { echo "hello\n"; return true; } func(); // ok assert('ns\func()'); i believe normal behavior; assert built in function, , you're passing string evaluated. when execution passes inside of assert function, in different namespace (mainly global namespace).
Comments
Post a Comment