On Tue, 4 Dec 2007, Gregory Beaver wrote:
> However, in the global scope (no namespace) it would fail. This is a
> bug that is easily fixed. use should allow re-aliasing of global
> classes, and I could provide a very easy fix.
No, use should not allow this. Take the following example:
<?php
namespace blah;
use DomDocument as test;
class DOMDocument { }
$dom = new DOMDocument; //
$dom->loadXML('<books><book><title>blah</title></book></books>');
$s = simplexml_import_dom($dom);
echo $s->book[0]->title; // blah
?>
Besides this being a *big* WTF factor (why is my internal class
suddendly doing something else?) simplexml will horrible fail in this
case.
Derick
--
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php