Re: [RFC] Remove PHP 4 Constructors
| From: | Tony Marston | Date: | Thu, 22 Jan 2015 18:01:59 +0000 |
| Subject: | Re: [RFC] Remove PHP 4 Constructors | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80981@lists.php.net to get a copy of this message | ||
"Arvids Godjuks" wrote in message news:CAL0xaBFDOP0402T06DJLjbmv6CgsS+xcnY69=SZrZts5br5Z8Q@mail.gmail.com...
2015-01-22 15:22 GMT+02:00 Arvids Godjuks <arvids.godjuks@gmail.com>:You are missing one important detail. That section only applies if I use namespaces, and - guess what - I DON'T. -- Tony Marston2015-01-21 19:21 GMT+02:00 Tony Marston <TonyMarston@hotmail.com>:Omg, a folowup. I just found a gem in the docs: "As of PHP 5.3.3, methods with the same name as the last element of a namespaced class name will no longer be treated as constructor. This change doesn't affect non-namespaced classes." Can be read here: http://lv.php.net/manual/en/language.oop5.decon.php So, I think this seals the deal :)"Kristopher" wrote in message news:CAF9U7z_BLDusnq7c0mVToxyJpqOpa+ tmATgqrb7YQeips11fxQ@mail.gmail.com...By this time, you could have opened your project/projects in any Regex search and replace capable editor/IDE, wrote a pattern that matches class name with a method name same as class name and replaces it with __construct. Takes about 5-10 minutes for the first project to get it right, ensures forward compatibility since 5.0.0 and saves your employer all those hours that you just spend arguing. Or just write a PHP script that does the same - even easier and faster...On Wed, Jan 21, 2015 at 9:50 AM, Tony Marston <TonyMarston@hotmail.com> wrote:Because I would rather fight for valid principles than give in. To quote Emiliano Zapata "It is better to die on your feet than live on your knees".You are totally missing the point. It is the principle of having to spend unknown quantities of time in refactoring my code for nothing more than a frivolous and unnecessary break in BC. It does not fix a bug or a security issue, therefore it is frivolous and unnecessaryYet you seem to have no problem wasting loads of time arguing about it on the internet.