Stanislav Malyshev wrote:
Hi!

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

But existing code can be converted to use namespaces. And the design is explicitly made so that it would be easy to do. Forcing people to rename functions in existing code for no reason doesn't look like a good idea.

???

I have done this exact process of renaming old-style constructors to __construct() in my code when PHP 5 came out, it took me as much time as typing "namespace Blah;" takes.

Huge -1 for this non-issue. When converting to namespace, you just add __construct() and get on with your life, no harm, no foul. In addition, when converting PHP4 to PHP5, there are always little changes that must be made, especially when targeting E_STRICT. One of them is in fact that old-style constructors should be replaced with __construct!

Namespaces *already* forces rewrite of small portions of code, this is no different. For instance, all dynamic references need the fully qualified namespace name, as we know.

As Pierre points out, the fatal parse error can simply explain the function "Blah" must be renamed to "__construct"

Greg

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

Reply via email to