Re: [PHP-DEV] Re: The curious case of the comparable objects.

2018-08-13 Thread Nikita Popov
On Sun, Aug 12, 2018 at 6:43 PM, Sara Golemon wrote: > On Sun, Aug 12, 2018 at 12:47 AM, Stanislav Malyshev > wrote: > > Undefined behavior is undefined :) > > > (Ignoring your followup for a moment) > Even for undefined behavior, we should *try* to make the behavior > repeatable. I know we wou

Re: [PHP-DEV] Re: The curious case of the comparable objects.

2018-08-12 Thread Sara Golemon
On Sun, Aug 12, 2018 at 12:47 AM, Stanislav Malyshev wrote: > Undefined behavior is undefined :) > (Ignoring your followup for a moment) Even for undefined behavior, we should *try* to make the behavior repeatable. I know we wouldn't need to, but we should always go for least surprise. It's the s

Re: [PHP-DEV] Re: The curious case of the comparable objects.

2018-08-12 Thread Christoph M. Becker
On 12.08.2018 at 07:47, Stanislav Malyshev wrote: >> > > Ah, I forgot that the spec did define it via array comparison. The spec > also says in > https://github.com/php/php-langspec/blob/mas

Re: [PHP-DEV] Re: The curious case of the comparable objects.

2018-08-11 Thread Stanislav Malyshev
Hi! > Ah, I forgot that the spec did define it via array comparison. The spec also says in https://github.com/php/php-langspec/blob/master/spec/08-conversions.md#converting-to-array-type: T

[PHP-DEV] Re: The curious case of the comparable objects.

2018-08-11 Thread Sara Golemon
On Sat, Aug 11, 2018 at 8:34 AM, Christoph M. Becker wrote: >> 2. Is it a bug introduced in 5.4 that's okay to fix? Or would fixing >> it count as a BC break due to how long it's been broken? (I say >> fixable bug, the BC break was at 5.4) > > I tend to agree, even though the behavior is not reall

[PHP-DEV] Re: The curious case of the comparable objects.

2018-08-11 Thread Christoph M. Becker
On 10.08.2018 at 17:12, Sara Golemon wrote: > One of the contributors for the "Because, PHP" page came up with a fun > example where the result of object comparison changes upon observation > of that object. > > class A { public $a; } > class B extends A { public $b; } > $a = new B(); $a->a = 0;