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

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

2018-08-11 Thread Stanislav Malyshev
Hi! > 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. Undefined behavior is undefined :) > 1. Does this matter? (I think so, it's spooky action at a distance) No. There's no defined

[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

Re: [PHP-DEV] Re: RFC Proposal

2018-08-11 Thread Niklas Keller
I'd be fine with throwing exceptions in PHP 7.4, but maybe a warning in PHP 7.4 and an exception in 8.0 then? Things like that can be a pretty stupid error that doesn't get noticed, and there are probably not many use cases checking the return to be false and then not throwing an exception. Regar

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

[PHP-DEV] Re: RFC Proposal

2018-08-11 Thread Christoph M. Becker
On 10.08.2018 at 22:15, Jesse G. Donat wrote: > I'm measuring reaction for an RFC > > Essentially right now preg regex's fail silently - and you have to > actually check them manually with preg_last_error - something I've > never actually seen done in code. > > see: > > https://github.com/php/p

Re: [PHP-DEV] object destruction php 5.6 vs. 7.2

2018-08-11 Thread Nikita Popov
On Wed, Aug 8, 2018 at 11:09 PM, Nicolai Scheer wrote: > Hi, > > I'm currently facing difficulties to migrate one of our extension from php > 5.6 to 7.2. > > Basically everything works fine. > The extension defines its own resource, and since it's object oriented, > stores the resource inside a m