Re: [RFC] Remove PHP 4 Constructors

From: Date: Fri, 16 Jan 2015 11:28:26 +0000
Subject: Re: [RFC] Remove PHP 4 Constructors
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-80635@lists.php.net to get a copy of this message
On Thu, 15 Jan 2015, Levi Morrison wrote: > On Thu, Jan 15, 2015 at 9:55 AM, Andrea Faulds <ajf@ajf.me> wrote: > > > > Upon further thought, I’m not super-enthusiastic about this. As has > > been pointed out, it’s a pretty serious BC break, whether code can > > be automatically updated or not. PHP 4 constructors may be obsolete, > > but an awful lot of code uses them. > > > > A better solution, IMO, might be simply to add a deprecation notice. > > This would make it obvious during development if you’ve accidentally > > defined a PHP4 constructor, and would encourage migration away from > > them, but wouldn’t prevent existing code from working. > > Possibly. The reality of my position is that I am unhappy about our > current constructor situation. Having __construct and only > half-heartedly supporting old-style constructors for the next several > years (maybe ten?) does not sound good at all. > > Removing one of the constructors is a nicer end product than fully > supporting both, in my opinion, which is why I proposed dropping it. Instead of just dropping it, which would likely generate odd bugs, declaring an old style constructor should *tell* you it's no longer working- perhaps with as strong of an error as an E_COMPILE_ERROR—atleast for PHP 7. Just removing it support would, IMO, be silly. cheers, Derick

« previous php.internals (#80635) next »