Josh Davis wrote:
> 2008/10/27 Stanislav Malyshev <[EMAIL PROTECTED]>:
> 
>> 1) check for namespaced\classname
>> 2) try to autoload namespaced\classname
>> 3) fail
> 
> Ok, that makes some sense wrt your position, which I originally
> interpreted as namespace/internal/autoload.
> 
> You want to force users to use the full name at all times. IOW, you
> want to sacrifice convenience for performance. On the upside, no
> ambiguity whatsoever. "new Foo" is always a namespaced class. The
> downside is that it makes it harder for users to copy/paste code from
> current tutorials and examples, they will have to fix the class names.
> Also, a few people will probably regret not being able to
> auto-magically override some internal classes (e.g. override PDO to
> log queries and what not) and it will probably increase the amount of
> complaints about peppering one's code with backslashes.

<?php
namespace Foo;
use \PDO;
$a = new PDO; // $a is an object of class PDO
?>

<?php
namespace Foo;
use Clever\newversion\of\PDO;
$a = new PDO; // $a is now an object of class Clever\newversion\of\PDO
?>

Greg

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to