3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj1 = new StdClass(); $obj1->name = ‘Darth’; $obj2 = new StdClass(); $obj2->name = ‘Vader’; echo [$obj1, $obj2][0]->name;
based on 2eGa2
Output for 7.2.0
Warning: Use of undefined constant ‘Darth’ - assumed '‘Darth’' (this will throw an Error in a future version of PHP) in /in/djdVc on line 3 Warning: Use of undefined constant ‘Vader’ - assumed '‘Vader’' (this will throw an Error in a future version of PHP) in /in/djdVc on line 6 ‘Darth’
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant ‘Darth’ - assumed '‘Darth’' in /in/djdVc on line 3 Notice: Use of undefined constant ‘Vader’ - assumed '‘Vader’' in /in/djdVc on line 6 ‘Darth’
Output for 5.5.24 - 5.6.28
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ',' or ';' in /in/djdVc on line 8
Process exited with code 255.
Output for 5.4.10 - 5.4.45
Parse error: syntax error, unexpected '[', expecting ',' or ';' in /in/djdVc on line 8
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/djdVc on line 8
Process exited with code 255.