From:             titch at tut dot by
Operating system: Ubuntu 12.04
PHP version:      5.4.3
Package:          Class/Object related
Bug Type:         Bug
Bug description:Namespace conflict with Reflection

Description:
------------
if namespace defined, ReflectionObject can't find class by name with
namespace prefix

[Sun Jun 03 22:56:50 2012] [error] [client 127.0.0.1] PHP Fatal error: 
Class 'MyProject\\ReflectionObject' not found in
/var/www/myproject/MyClass.php on line 6

also namespaces doesn't works with ReflectionClass etc.

but all those scripts work without namespace

Test script:
---------------
//500 Internal Server Error
<?php
namespace MyProject;
class MyClass {
  function ff(){
    a = new ReflectionObject($this);
    echo 'it works';
  }
}
$a = new MyClass();
$a->ff();
?>


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

Reply via email to