Edit report at http://bugs.php.net/bug.php?id=52275&edit=1

 ID:               52275
 Updated by:       johan...@php.net
 Reported by:      crash at lubyte dot de
 Summary:          Add error reporting level for namespace fallback
-Status:           Open
+Status:           Wont fix
 Type:             Feature/Change Request
 Package:          Scripting Engine problem
 Operating System: All
 PHP Version:      5.3.2

 New Comment:

Triggering an error - even when not shown - is way slower than the
additional lookup which is well optimised.


Previous Comments:
------------------------------------------------------------------------
[2010-07-07 17:20:08] crash at lubyte dot de

Description:
------------
Hello,



currently it's not possible to see if PHP tries to fallback to a global
function/constant when the function/constant isn't found in the current
namespace.



This can lead to perfomence problems when developers convert older
classes to PHP 5.3 namespaces and forget to prefix standard functions
with a backslash.



This also helps people to learn what functions need to be called from
the global space and which not.

Test script:
---------------
namespace Foo;



function bar() {

    // would be nice if that would trigger a warning

    return phpversion();

}



function baz() {

    // no warning

    return \phpversion();

}

Expected result:
----------------
a error level constant E_NAMESPACE_FALLBACK to use for error_reporting()



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52275&edit=1

Reply via email to