Re: [PHP-DEV] Evaluate arguments of new for classes without constructors

2016-03-12 Thread Nikita Popov
On Sat, Mar 12, 2016 at 6:54 PM, Paul M. Jones wrote: > > > On Mar 12, 2016, at 11:27, Sara Golemon 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

Re: [PHP-DEV] Evaluate arguments of new for classes without constructors

2016-03-12 Thread Paul M. Jones
> On Mar 12, 2016, at 11:27, Sara Golemon 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

Re: [PHP-DEV] Evaluate arguments of new for classes without constructors

2016-03-12 Thread Sara Golemon
On Sat, Mar 12, 2016 at 8:01 AM, Nikita Popov wrote: > class Foo {} > new Foo(print 'xyz'); > > will not print "xyz", because the arguments to "new" are not evaluated if > the class has no constructor. Conversely > I recall someone once dubbing this "The Rasmus Optimization". I don't know