Re: [PHP-DEV] [RFC] !instanceof operator - reaction measuremen

2021-12-13 Thread Kalle Sommer Nielsen
Den man. 13. dec. 2021 kl. 12.53 skrev Oliver Nybroe : > What do people think about this? Would love to clarify if needed. > > Best regards > Oliver Nybroe (he/him) I find this to be more a problem to be solved by individual coding standards and cs tools. The !instanceof syntax is awkward at

Re: [PHP-DEV] [RFC] !instanceof operator - reaction measuremen

2021-12-13 Thread Oliver Nybroe
> The "instanceof" is counterintuitive for me compared to operators. Hmm interesting, might be possible to go that direction by making `T_IS_EQUAL` accept `class_name_reference`. I like that, biggest concern with this is what is the difference (if any) between ```php $object !== MyClass $object !=

Re: [PHP-DEV] [RFC] !instanceof operator - reaction measuremen

2021-12-13 Thread Lynn
On Mon, Dec 13, 2021 at 12:19 PM Michał Marcin Brzuchalski < michal.brzuchal...@gmail.com> wrote: > > Why not "not" instead? The "!" in front of "i" in "!implements" is almost > not visible which IMO could get easily ignored unintentionally. > Instead constructs like "$foo not implements

Re: [PHP-DEV] [RFC] !instanceof operator - reaction measuremen

2021-12-13 Thread Michał Marcin Brzuchalski
pon., 13 gru 2021 o 12:10 Lynn napisał(a): > Heya, > > While I definitely agree with this, and after more than 10 years of PHP I > still have the tendency to write `if ($object !instanceof MyClass)` anyway. > Would it be possible, or would it collide with constants to do the > following? > ``` >

Re: [PHP-DEV] [RFC] !instanceof operator - reaction measuremen

2021-12-13 Thread Lynn
Heya, While I definitely agree with this, and after more than 10 years of PHP I still have the tendency to write `if ($object !instanceof MyClass)` anyway. Would it be possible, or would it collide with constants to do the following? ``` $object === MyClass; $object !== MyClass; ``` The reason

[PHP-DEV] [RFC] !instanceof operator - reaction measuremen

2021-12-13 Thread Oliver Nybroe
I would like to create my first RFC proposing adding a new operator `!instanceof` named `T_NOT_INSTANCEOF`. The purpose of this RFC is to add syntactic sugar for checking if an object is not an instance of something else. The current syntax for checking not instance of looks the following way