3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface i1 { } class a { function find() { return null; } function _do(i1 $x) { var_dump("do".$x); } function main() { if ($this->n = $a->find() && _do($this->n)) { echo "yes"; } } } $a = new a(); $a->main();
based on qaaIC
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: a in /in/2kvVn on line 17 Fatal error: Uncaught Error: Call to a member function find() on null in /in/2kvVn:17 Stack trace: #0 /in/2kvVn(24): a->main() #1 {main} thrown in /in/2kvVn on line 17
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: a in /in/2kvVn on line 17 Fatal error: Uncaught Error: Call to a member function find() on unknown in /in/2kvVn:17 Stack trace: #0 /in/2kvVn(24): a->main() #1 {main} thrown in /in/2kvVn on line 17
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Notice: Undefined variable: a in /in/2kvVn on line 17 Fatal error: Call to a member function find() on null in /in/2kvVn on line 17
Process exited with code 255.
Output for 5.3.17 - 5.5.35
Notice: Undefined variable: a in /in/2kvVn on line 17 Fatal error: Call to a member function find() on a non-object in /in/2kvVn on line 17
Process exited with code 255.