The PHP 7 Revolution: Return Types and Removed Artifacts

For major releases of any software (taking PHP as an example from 5.x to 7.0) I would always expect there to be major changes to things and for some backwards compatibility to break. There has to come a point with any given version of a software package that the developers say “as of we will no longer support version of ” it’ll be a split as to the cost of maintaining old codebases and the time taken to maintain them.

I personally see the removal of PHP 4 constructors as a very minor change. I believe that the __construct() was introduced around 6-7 years ago, given how minor a change that is to any classes and the time that __construct() has been around tbf I can’t think of any good reason why any PHP classes haven’t been updated from PHP4 style constructors over to _construct(). If I was looking for a class to use for something and I saw a PHP4 style constructor (or the old mysql* extension), it would be sent straight to the Recycle Bin.

If I was doing PHP programming as my job, I wouldn’t support at all any version older then 5.4 and once PHP7 came out I’d tell any customers that I’d be ending support for 5.4 at some point (probably six months after the release of PHP7)

Off-topic: Just flicking through http://pastebin.com/ujpUuN1r if I was viewing that code for the first time the use of addslashes() would raise a red flag for me and unless it’s escaped elsewhere the use of user submitted data in the database without escaping it would raise another red flag. imo there is no valid reason to not be using prepared statements when dealing with user submitted data