Hi all,
would it be safer that get_class return the fully qualified class name ?
namespace A\B\C {
class Test { }
echo get_class( new Test ); // it prints A\B\C\Test
};
It should print \A\B\C\Test, as explained
http://php.net/manual/en/language.namespaces.rules.php
Martin Scotta
No, this wouldnt be backwards compatible to the PHP 5.2 behavior, hence inconsistent.
The convention is class names in strings are ALWAYS fully qualified, therefore the prefix backslash is not necessary.
On Wed, 23 Feb 2011 15:14:45 -0300
Martin Scotta martinscotta@gmail.com wrote:
Hi all,
would it be safer that get_class return the fully qualified class name ?
namespace A\B\C {
class Test { }
echo get_class( new Test ); // it prints A\B\C\Test
};It should print \A\B\C\Test, as explained
http://php.net/manual/en/language.namespaces.rules.phpMartin Scotta