From:             
Operating system: All
PHP version:      5.3.2
Package:          Scripting Engine problem
Bug Type:         Feature/Change Request
Bug description:Add error reporting level for namespace fallback

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 bug report at http://bugs.php.net/bug.php?id=52275&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52275&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52275&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52275&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52275&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52275&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52275&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52275&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52275&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52275&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52275&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52275&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52275&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52275&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52275&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52275&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52275&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52275&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52275&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52275&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52275&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52275&r=mysqlcfg

Reply via email to