Re: On constructors: BC Break and Class compiler Improvements
| From: | Stanislav Malyshev | Date: | Thu, 01 Apr 2010 19:41:15 +0000 |
| Subject: | Re: On constructors: BC Break and Class compiler Improvements | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-47718@lists.php.net to get a copy of this message | ||
Hi!
No, that's a pretty bad band-aid. I'd not be comfortable with such kludge being there, esp. when we are just establishing a new style for namespaced code.I don't like this. The behavior should not depend on other methods being defined. What if you refactored the class and moved the ctor out to the parent - and the you get a nasty surprise of filter() suddenly becoming new ctor?Consider this idea a band-aid. It would basically allow for us to move forward in the 5.x branch with backwards compatibility until 6.x drops and PHP4 style constructors can go away forever.
In general, it seems like method names of the same as the class name should *NOT* be marked as the class constructor if they are static.Maybe, but that's seems to be too subtle distinction to have, and in the light of the previous issue (not having it be ctor ever) it doesn't matter anyway :) -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com