note 89926 modified in language.oop5.reflection by danbrown
| From: | danbrown@php.net | Date: | Wed, 16 Sep 2009 16:10:05 +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-160706@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:
<?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');
?>
http://php.net/manual/en/language.oop5.reflection.php