Re: Evaluate arguments of new for classes without constructors

From: Date: Sat, 12 Mar 2016 18:16:24 +0000
Subject: Re: Evaluate arguments of new for classes without constructors
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-91645@lists.php.net to get a copy of this message
On Sat, Mar 12, 2016 at 6:54 PM, Paul M. Jones <pmjones88@gmail.com> wrote: > > > On Mar 12, 2016, at 11:27, Sara Golemon <pollita@php.net> wrote: > > > >> HHVM does not implement "new" in this way, they always evaluate the > arguments. > >> > > Which, if it helps, means that we already know a lot of frameworks > > /don't/ break as a result of fixing this behavior. > > > >> As this is technically a BC affecting change (even if of the lowest > >> impact), I'm running it past the list first. > >> > > Technically a BC break that justifies waiting till a major version. > > Given the extremely specific requirements to hit this edge case > > however, passing side-effect args to a non-existent constructor, I > > personally think a minor version is fine. > > Of curiosity, what effect (if any) might this have on > ReflectionClass::newInstance(), ::newInstanceArgs(), and > ::newInstanceWithoutConstructor()? (I ask because some existing DI > systems, such as Aura.Di, rely on those for creating objects.) There is no effect on any the ReflectionClass::newInstance*() methods, only direct use of the "new" operator is affected. Nikita

« previous php.internals (#91645) next »