3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( "name"=>"a", "id"=>"b", "date"=>"c", "name"=>"1", "id"=>"2", "date"=>"3" ); print_r($array); echo end($array['id']); echo $array['id'];
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Array ( [name] => 1 [id] => 2 [date] => 3 ) Warning: end() expects parameter 1 to be array, string given in /in/r0eAr on line 11 2
Output for hhvm-3.10.0 - 3.12.0
Array ( [name] => 1 [id] => 2 [date] => 3 ) Warning: Invalid operand type was used: expecting an array in /in/r0eAr on line 11 2
Output for 4.3.2 - 5.2.17
Array ( [name] => 1 [id] => 2 [date] => 3 ) Warning: end(): Passed variable is not an array or object in /in/r0eAr on line 11 2
Output for 4.3.0 - 4.3.1
Array ( [name] => 1 [id] => 2 [date] => 3 ) Warning: end() [http://www.php.net/function.end]: Passed variable is not an array or object in /in/r0eAr on line 11 2