note 89926 modified in language.oop5.reflection by danbrown
| From: | danbrown@php.net | Date: | Sun, 29 Mar 2009 15:02:54 +0000 |
| Subject: | note 89926 modified in language.oop5.reflection by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152580@lists.php.net to get a copy of this message | ||
To reflect on a namespaced class in PHP 5.3, you must always specify the fully qualified name of the
class - even if you've aliased the containing namespace using a "use" statement.
So instead of:
<?php
use App\Core as Core;
$oReflectionClass = new ReflectionClass('Core\Singleton');
?>
You would type:
<?php
use App\Core as Core;
$oReflectionClass = new ReflectionClass('App\Core\Singleton');
?>
--was--
To reflect on a namespaced class in PHP 5.3, you must always specify the fully qualified name of the
class - even if you've aliased the containing namespace using a "use" statement.
So instead of:
use App\Core as Core;
$oReflectionClass = new ReflectionClass('Core\Singleton');
You would type:
use App\Core as Core;
$oReflectionClass = new ReflectionClass('App\Core\Singleton');
http://php.net/manual/en/language.oop5.reflection.php