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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -