3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = ['a' => 'b', 'c' => 'd']; for($i=0;$i<sizeof($test);$i++) { echo $test[$i]->getTitle(); }
based on HmkhI
Output for 7.0.0 - 7.2.0
Notice: Undefined offset: 0 in /in/BsVPJ on line 5 Fatal error: Uncaught Error: Call to a member function getTitle() on null in /in/BsVPJ:5 Stack trace: #0 {main} thrown in /in/BsVPJ on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Undefined offset: 0 in /in/BsVPJ on line 5 Fatal error: Call to a member function getTitle() on null in /in/BsVPJ on line 5
Process exited with code 255.
Output for 5.4.11 - 5.5.35
Notice: Undefined offset: 0 in /in/BsVPJ on line 5 Fatal error: Call to a member function getTitle() on a non-object in /in/BsVPJ on line 5
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/BsVPJ on line 3
Process exited with code 255.