note 92764 added to language.namespaces.dynamic
| From: | scott at intothewild dot ca | Date: | Fri, 07 Aug 2009 22:33:34 +0000 |
| Subject: | note 92764 added to language.namespaces.dynamic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159203@lists.php.net to get a copy of this message | ||
as noted by guilhermeblanco at php dot net,
<?php
// fact.php
namespace foo;
class fact {
public function create($class) {
return new $class();
}
}
?>
<?php
// bar.php
namespace foo;
class bar {
...
}
?>
<?php
// index.php
namespace foo;
include('fact.php');
$foofact = new fact();
$bar = $foofact->create('bar'); // attempts to create \bar
// even though foofact and
// bar reside in \foo
?>
----
Server IP: 216.235.13.26
Probable Submitter: 96.52.5.124
----
Manual Page -- http://www.php.net/manual/en/language.namespaces.dynamic.php
Edit -- https://master.php.net/note/edit/92764
Del: integrated -- https://master.php.net/note/delete/92764/integrated
Del: useless -- https://master.php.net/note/delete/92764/useless
Del: bad code -- https://master.php.net/note/delete/92764/bad+code
Del: spam -- https://master.php.net/note/delete/92764/spam
Del: non-english -- https://master.php.net/note/delete/92764/non-english
Del: in docs -- https://master.php.net/note/delete/92764/in+docs
Del: other reasons-- https://master.php.net/note/delete/92764
Reject -- https://master.php.net/note/reject/92764
Search -- https://master.php.net/manage/user-notes.php