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
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php