The Wayback Machine - https://web.archive.org/web/20201010040150/https://github.com/bobthecow/psysh/issues/519
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instanceof syntax check does not work for arrays #519

Closed
tgr opened this issue Aug 28, 2018 · 3 comments
Closed

instanceof syntax check does not work for arrays #519

tgr opened this issue Aug 28, 2018 · 3 comments

Comments

@tgr
Copy link
Contributor

@tgr tgr commented Aug 28, 2018

More of a curiosity than a bug, really.

Psy Shell v0.9.7 (PHP 7.0.30-0ubuntu0.16.04.1 — cli) by Justin Hileman
>>> false instanceof StdClass
PHP Fatal error:  instanceof expects an object instance, constant given in Psy Shell code on line 1
>>> [] instanceof StdClass
PHP Fatal error:  instanceof expects an object instance, constant given in phar:///home/tgr/bin/psysh/src/ExecutionLoopClosure.php(53) : eval()'d code on line 1
@tgr
Copy link
Contributor Author

@tgr tgr commented Aug 28, 2018

OK, that wasn't very helpful... so the first error is from PsySH's syntax checker (red background, does not break history), the second is a real PHP fatal (plain background, breaks history).

@bobthecow
Copy link
Owner

@bobthecow bobthecow commented Aug 28, 2018

yeah, it looks like our list of "valid" instanceof calls isn't quite right.

array(1) instanceof stdClass, (1+1) instanceof stdClass and DateTime::ISO8601 instanceof stdClass all fail.

@bobthecow
Copy link
Owner

@bobthecow bobthecow commented Mar 15, 2020

This has shipped with v0.10.0

@bobthecow bobthecow closed this Mar 15, 2020
@bobthecow bobthecow removed the done label Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.