Bug #62218 [Opn]: Namespace conflict with Reflection
| From: | titch at tut dot by | Date: | Sun, 03 Jun 2012 20:15:35 +0000 |
| Subject: | Bug #62218 [Opn]: Namespace conflict with Reflection | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-171005@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62218&edit=1
ID: 62218
User updated by: titch at tut dot by
Reported by: titch at tut dot by
Summary: Namespace conflict with Reflection
Status: Open
Type: Bug
Package: Class/Object related
Operating System: Ubuntu 12.04
PHP Version: 5.4.3
Block user comment: N
Private report: N
New Comment:
sorry, comment "//500 Internal Server Error" was added while posting
remove it, cause namespace must be first directive at script
but it's doesn't fix problem with Reflection, it just misspast
Previous Comments:
------------------------------------------------------------------------
[2012-06-03 20:10:13] titch at tut dot by
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 this bug report at https://bugs.php.net/bug.php?id=62218&edit=1