3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function test(ArrayAccess $errors) { $errors[] = 'This is an error!'; } } $foo->test($error, $errors = array()); var_dump($errors);
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: foo in /in/REl0g on line 13 Fatal error: Uncaught Error: Call to a member function test() on null in /in/REl0g:13 Stack trace: #0 {main} thrown in /in/REl0g on line 13
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: foo in /in/REl0g on line 13 Fatal error: Uncaught Error: Call to a member function test() on unknown in /in/REl0g:13 Stack trace: #0 {main} thrown in /in/REl0g on line 13
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Undefined variable: foo in /in/REl0g on line 13 Fatal error: Call to a member function test() on null in /in/REl0g on line 13
Process exited with code 255.
Output for 5.3.19 - 5.5.35
Notice: Undefined variable: foo in /in/REl0g on line 13 Fatal error: Call to a member function test() on a non-object in /in/REl0g on line 13
Process exited with code 255.