Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants.

2017-12-08 Thread Andreas Hennings
Why is the usage broken? It works :) In practice, the current version of instanceof has an is_object() built-in. This is what people could assume from trying. Of course I don't know how it is implemented internally. Maybe a kitten dies every time I use instanceof on non-object variables? If we ne

Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants.

2017-12-08 Thread Kalle Sommer Nielsen
Hi That is fine for code that is broken in the first place. Similarly we added a warning some years back about array to string conversions. If your code is like the example, it should be updated and warned about as you are doing something illogical by first checking the type and or value of the o

Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants.

2017-12-08 Thread Andreas Hennings
Adding a warning to something that used to be ok would break existing code. I remember a number of cases where I used instanceof on possibly non-objects. if ($x instanceof C) { return $x; } elseif ($x === NULL) { ... } All such code would then produce warnings. On 9 December 2017 at 07:35, K

Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants.

2017-12-08 Thread Kalle Sommer Nielsen
Hi We should just add a warning to the first example, it seems like an oversight that it was left silent On 9 Dec 2017 07.29, "Andreas Hennings" wrote: > The following (https://3v4l.org/A2Tp6) is ok, it simply returns false: > > $x = 1; > $x instanceof \stdClass; > > > The following (ht

[PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants.

2017-12-08 Thread Andreas Hennings
The following (https://3v4l.org/A2Tp6) is ok, it simply returns false: $x = 1; $x instanceof \stdClass; The following (https://3v4l.org/IdSBu) gives a fatal error: 1 instanceof \stdclass; t think this behavior is inconsistent, and we should consider changing it. There are two opti

Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax

2017-12-08 Thread li...@rhsoft.net
Am 08.12.2017 um 18:55 schrieb Stephen Reay: On 8 Dec 2017, at 5:16 pm, li...@rhsoft.net wrote: "Now expressing the same thing in two different ways, with or without & is confusing, so I think one needs to think about if old syntax should be deprecated in 8.0" woul

Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax

2017-12-08 Thread Stephen Reay
> On 8 Dec 2017, at 5:16 pm, li...@rhsoft.net wrote: > > "Now expressing the same thing in two different ways, with or without & is > confusing, so I think one needs to think about if old syntax should be > deprecated in 8.0" would be a massive BC break That wasn’t in Rowans suggestion, it was

Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax

2017-12-08 Thread li...@rhsoft.net
Am 08.12.2017 um 17:36 schrieb CHU Zhaowei: On Fri, Dec 8, 2017 06:16 PM, "li...@rhsoft.net" wrote: > >and it's much bader to use a not so long existed syntax which was now >changed to a fatal error - just type "php call-by-reference" in google > I know most people of this list using and c

Re: [PHP-DEV] Outstanding php.net account requests

2017-12-08 Thread Peter Cowburn
On 5 December 2017 at 13:57, Christoph M. Becker wrote: > On 05.12.2017 at 14:34, Pedro Magalhães wrote: > > > On Tue, Dec 5, 2017 at 12:49 PM, Johannes Schlüter < > johan...@schlueters.de> > > wrote: > > > >> we currently have 118 outstanding php.net account requests going back > >> to October 2

Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax

2017-12-08 Thread CHU Zhaowei
On Fri, Dec 8, 2017 06:16 PM, "li...@rhsoft.net" wrote: > >and it's much bader to use a not so long existed syntax which was now >changed to a fatal error - just type "php call-by-reference" in google > I know most people of this list using and contributing to PHP for a very long time, but I want

Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax

2017-12-08 Thread li...@rhsoft.net
Am 08.12.2017 um 05:41 schrieb Stephen Reay: On 8 Dec 2017, at 08:54, "li...@rhsoft.net" wrote: Am 08.12.2017 um 01:38 schrieb Björn Larsson: Den 2017-12-06 kl. 20:49, skrev Nikita Popov: Hi internals, I'd like propose optional support for explicitly marking by-reference argument pass