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

2016-03-12 Thread Nikita Popov
Hi internals, Currently 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 class Foo { function __construct() {} } new Foo(print 'xyz'); *will* print "xyz". This behavior is confu

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

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 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

[PHP-DEV] Re: [RFC Proposal] Null Coalesce Equal Operator

2016-03-12 Thread Andrea Faulds
Hi Midori, Midori Kocak wrote: Forgive my rookieness and let me introduce my first RFC here: https://wiki.php.net/rfc/null_coalesce_equal_operator I think this is a reasonable proposal. I had foreseen that we might add a ??= operator s

Re: [PHP-DEV] PCRE JIT stack size limit

2016-03-12 Thread David Zuelke
Just wanted to resurrect this thread... I just got a JIT stack size limit error (which Composer reports as "unknown error" because it has no logic for the new constant) while running "composer require somepackage" with PHP 7 and JIT enabled. IMO, a pattern modifier would be good so that applica