> 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 != MyClass
```

> If this isn't possible and `!instanceof` would be adopted, what about the
following in addition to the proposed example?
I definitely agree that those make sense, but I would say that they should
prob. have their own discussion, but would be much easier to get through if
this one would be accepted.

> Why not "not" instead? The "!" in front of "i" in "!implements"
Might be my limited knowledge on the subject, but by using `not`, we are
making `not` a reserved keyword, which I think should be done really
carefully.


Best regards
Oliver Nybroe (he/him)


On Mon, 13 Dec 2021 at 12:19, Michał Marcin Brzuchalski <
michal.brzuchal...@gmail.com> wrote:

>
>
> pon., 13 gru 2021 o 12:10 Lynn <kja...@gmail.com> 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?
>> ```
>> $object === MyClass;
>> $object !== MyClass;
>> ```
>> The reason I'm hoping this would be possible, is that I often have
>> brainlag
>> trying to write "instanceof" and I either make several typos, or I end up
>> with "instance" and it takes me an error message to realize I forgot the
>> "of". The "instanceof" is counterintuitive for me compared to operators.
>>
>> If this isn't possible and `!instanceof` would be adopted, what about the
>> following in addition to the proposed example?
>> ```
>> $object implements MyInterface;
>> $object !implements MyInterface;
>> $object extends MyClass;
>> $object !extends MyClass;
>> ```
>>
>
> 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 stdClass" have higher
> visibility and are currently a syntax error.
>
> Cheers,
> Michał Marcin Brzuchalski
>

Reply via email to