Re: Re: Order of class resolution with namespaces and autoload

From: Date: Sat, 20 Oct 2007 20:57:42 +0000
Subject: Re: Re: Order of class resolution with namespaces and autoload
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-32883@lists.php.net to get a copy of this message
<?php namespace Test; // explicitly tell PHP that we want Test::Exception to be autoloaded (in essence) import Test::Exception; class Tester {
    public function fail() {
        throw new Exception();
    }
} ?>
This is even better than requiring, and makes the intent very clear. I don't think it decreases intuitiveness, on the contrary - from the look of the code it is immediately clear which exception would be used. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32883) next »