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

2017-03-15 Thread Sara Golemon
On Wed, Mar 15, 2017 at 4:14 PM, Nikita Popov wrote: > Fixed in 7.1 by > https://github.com/php/php-src/commit/2bba4a0d7f6d5e5712d60bc1cf2119622d837e55. > Thanks! > I personally don't consider a PHP 7.0 backport worthwhile, as this is a long > standing issue (from early PHP

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

2017-03-15 Thread Nikita Popov
On Wed, Mar 15, 2017 at 3:53 PM, Sara Golemon wrote: > On Wed, Mar 15, 2017 at 5:36 AM, Nikita Popov > wrote: > > Yes, this should behave as C. See also https://bugs.php.net/bug.php? > id=69676 > > for an existing bug report on the topic. > > > Given that

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

2017-03-15 Thread Sara Golemon
On Wed, Mar 15, 2017 at 5:36 AM, Nikita Popov wrote: > Yes, this should behave as C. See also https://bugs.php.net/bug.php?id=69676 > for an existing bug report on the topic. > Given that bug is assigned to you, I'll just leave it in your hands then? > I think in 7.1 it

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

2017-03-15 Thread David Rodrigues
Just to make simpler to visualize this issue: https://3v4l.org/ZhYlm ```php class Foo { const A = 'Foo::A'; const B = self::A . ' and ' . self::C; const C = 'Foo::C'; } class Bar extends Foo { const A = 'Bar::A'; const C = 'Bar::C'; } var_dump(Bar::B); ``` You should note

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

2017-03-15 Thread Nikita Popov
On Wed, Mar 15, 2017 at 3:43 AM, 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; > const B = self::A | self::C; > const C = 1 << 1; > > } > > class Bar extends

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

[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