Re: [PHP-DEV] Unexpected results from constant folding

2017-03-14 Thread Sherif Ramadan
I would definitely vote C as well. PHP 7's behavior makes even less sense than PHP 5 in this case. On Tue, Mar 14, 2017 at 10:43 PM, Sara Golemon wrote: > This comes in thanks to my old friend Fred Emmott on the HHVM project: > https://3v4l.org/vUHq3 > > class Foo { > const A = 1 << 0; >

[PHP-DEV] Unexpected results from constant folding

2017-03-14 Thread Sara Golemon
This comes in thanks to my old friend Fred Emmott on the HHVM project: https://3v4l.org/vUHq3 class Foo { const A = 1 << 0; const B = self::A | self::C; const C = 1 << 1; } class Bar extends Foo { const A = 1 << 2; const C = 1 << 3; } var_dump(decbin(Bar::B)); // HHVM result

[PHP-DEV] GOOD Benchmark Results for PHP Master 2017-03-14

2017-03-14 Thread lp_benchmark_robot
Results for project PHP master, build date 2017-03-14 10:25:10-07:00 commit: edcabf6 previous commit:1e19611 revision date: 2017-03-13 22:07:15+01:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Stanislav Malyshev
Hi! > Additionally I feel that adding methods to stdClass will muddy the waters > -- for example, this means that extending stdClass is no longer entirely > unreasonable, as you might want to do it to reuse the __set_state() > implementation. Not something I want to see happening. I'm afraid that

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Jesse Schalken
On Wed, Mar 15, 2017 at 10:39 AM, Sara Golemon wrote: > > Oh yeah, btw... six hours ago... > https://github.com/php/php-src/commit/c74bc87c74f48bc55541b3bf2fc67d > 595f58a3b5 > > -Sara > Awesome, thanks Sara.

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Sara Golemon
On Tue, Mar 14, 2017 at 6:25 PM, Jesse Schalken wrote: > I didn't realise packed arrays could still have gaps. If that's the case, > why can't [12=>'foo', 42=>'bar'] be packed (index 0-11 and 13-41 are > undefined)? > It can be, but in practice isn't likely to be since that's a lot of empty space

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Jesse Schalken
On Wed, Mar 15, 2017 at 3:48 AM, Sara Golemon wrote: > > Minor nit: [12=>'foo', 42=>'bar'] is not a packed array. > > [0=>'foo', 2=>'bar'] is however, so your primary point stands. > However it should be simple enough to detect when a packed array is > also vector-like (indexed from 0 to n-1) and

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Nikita Popov
On Tue, Mar 14, 2017 at 11:20 PM, Derick Rethans wrote: > On Tue, 14 Mar 2017, Andrea Faulds wrote: > > > Hi everyone, > > > > Since stdClass has no __set_state method, var_export() produces unusable > > output if given an object of that class. I wrote a patch that would make > > var_export() pro

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Derick Rethans
On Tue, 14 Mar 2017, Andrea Faulds wrote: > Hi everyone, > > Since stdClass has no __set_state method, var_export() produces unusable > output if given an object of that class. I wrote a patch that would make > var_export() produce a cast to object instead, which could be evaluated to get > back

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Marc Bennewitz
Am 14.03.2017 um 20:26 schrieb Fleshgrinder: On 3/14/2017 7:57 PM, Andrea Faulds wrote: Hi everyone, Since stdClass has no __set_state method, var_export() produces unusable output if given an object of that class. I wrote a patch that would make var_export() produce a cast to object instead,

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Fleshgrinder
On 3/14/2017 7:57 PM, Andrea Faulds wrote: > Hi everyone, > > Since stdClass has no __set_state method, var_export() produces unusable > output if given an object of that class. I wrote a patch that would make > var_export() produce a cast to object instead, which could be evaluated > to get back

[PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Andrea Faulds
Hi everyone, Since stdClass has no __set_state method, var_export() produces unusable output if given an object of that class. I wrote a patch that would make var_export() produce a cast to object instead, which could be evaluated to get back a stdClass: https://github.com/php/php-src/pull/2

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Sara Golemon
On Tue, Mar 14, 2017 at 11:21 AM, Julien Pauli wrote: >> I noticed this commit >> > 9e853282fac968d9cd454> >> recently in HHVM, which makes array_values() return the same array back if >> it's packed instead of building a copy. >> >> My

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Julien Pauli
On Mon, Mar 13, 2017 at 6:34 AM, Jesse Schalken wrote: > I noticed this commit > 9e853282fac968d9cd454> > recently in HHVM, which makes array_values() return the same array back if > it's packed instead of building a copy. > > My unde

Re: [PHP-DEV] OPcache compilation performance regression in PHP 5.6/7 with huge classes

2017-03-14 Thread Nikita Popov
On Tue, Mar 14, 2017 at 11:29 AM, David Zuelke wrote: > Hi all, > > There appears to be a performance regression in the CFG and DFA based > optimization passes of OPcache in PHP 5.6+ when loading huge classes (such > as those generated by Symfony's routing component) for the first time. > > The i

[PHP-DEV] OPcache compilation performance regression in PHP 5.6/7 with huge classes

2017-03-14 Thread David Zuelke
Hi all, There appears to be a performance regression in the CFG and DFA based optimization passes of OPcache in PHP 5.6+ when loading huge classes (such as those generated by Symfony's routing component) for the first time. The issue does not occur on PHP 5.5. Tests below are with 5.6.30, 7.0.1