Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c zend_compile.c /tests ns_063.phpt

From: Date: Mon, 05 May 2008 18:43:31 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c zend_compile.c /tests ns_063.phpt
References: 1 2 3 4 5  Groups: php.internals php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6665@lists.php.net to get a copy of this message
It's just simple to make constructors work in the same way in namespaces and out of them. It would be difficult to explain why the first script prints "ok" and the second doesn't. <?php class Foo { function Foo() { echo "ok\"; } } new Foo(); ?> <?php namesapce Bar; class Foo { function Foo() { echo "ok\"; } } new Foo(); ?> I think, we must support old-style constructors for both cases or remove them at all, but as I said removing them would break a lot of old (non-namesapced) code. Thanks. Dmitry. Derick Rethans wrote:
On Mon, 5 May 2008, Dmitry Stogov wrote:
As we didn't drop this support yet, and it didn't work in namespaces by mistake I've fixed it to work in the same way as without namespaces. Removing this support won't give any speedup (except of compilation speed), but might break a lot of code.
How can it break existing code? It's only on issue if a class is part of a namespace, and existing code doesn't have namespaces. So it *can't* be breaking old code. regards, Derick


« previous php.zend-engine.cvs (#6665) next »