Hi!

b.php:
<?php
namespace Foo;
class A {
    function __construct() {throw new Exception('hi');}

Here in your proposal exhaustive autoload happens for all cases where you do not actually override Exception in Foo.

<?php
include 'a.php';
include 'b.php';
try {
$a = new A;
} catch (Foo::Exception $e) {
   echo "caught\n";
}
?>

throws a Foo::Exception and echoes "caught", demonstrating the importance of load order as well.

You could do use Foo::Exception in b.php too, to solve it.

Stas, your response is quite frustrating to this problem and fits a pattern. It seems the default response is always "no" or "that's not a real problem" and is almost always condescending. It makes it extremely

No, there's no "default response". Just in this case it happens that your proposal introduces significant problem - performance hit on some innocent construct without any indication of it happening. And the solution for it that you propose is not better than the original state of affairs - doing "use" solves both cases, and if not doing "use" then your case has more problems. It has nothing to do with me or you - it has to do with how things work in the engine.

difficult to have an intelligent debate with you. If you don't think something is a real problem, perhaps a better default response is "why

I think it is a problem, however I do not think this solution is going to make things better. I am sorry if it looked like condescending to you, it was not my intent. However, the conclusion still stays - I think as proposed, this solution introduces more problems than solves. I would be happy to find a solution that is better - and I am looking for one - but right not it isn't good enough.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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

Reply via email to