Req #52275 [Opn->Wfx]: Add error reporting level for namespace fallback
| From: | johannes@php.net | Date: | Thu, 08 Jul 2010 10:57:06 +0000 |
| Subject: | Req #52275 [Opn->Wfx]: Add error reporting level for namespace fallback | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152217@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52275&edit=1
ID: 52275
Updated by: johannes@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