3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array[] = array ( 'age' => 'Lower limit', 'shipments' => null, 'orders' => null, 'ifs' => null, 'items' => 2, 'highlight' => false ); $array[] = array ( 'age' => 'Upper limit', 'shipments' => null, 'orders' => null, 'ifs' => null, 'items' =>3, 'highlight' => false ); $array[] = array ( 'age' => 'Limits:', 'shipments' => null, 'orders' => null, 'ifs' => null, 'items' => null, 'highlight' => 1 ); $array[] = array ( 'age' => 'Freeze limit', 'shipments' => null, 'orders' => null, 'ifs' => null, 'items' => 1, 'highlight' => false ); $array2 = array ( 'ageing_data' => $array, ); foreach ($array2 as $row) { print_r(array_slice($row, 1)); } //print_r(array_slice($array2,1)); //print_r(array_values(array_slice($array, 1))); //print_r(implode('', array_map(function ($entry) { // return $entry['red']; //}, array_slice($a,1)))); //print_r(implode('',array_values(array_slice($a, 1))));
Output for 4.3.0 - 5.0.5, 5.1.1 - 7.1.0
Array ( [0] => Array ( [age] => Upper limit [shipments] => [orders] => [ifs] => [items] => 3 [highlight] => ) [1] => Array ( [age] => Limits: [shipments] => [orders] => [ifs] => [items] => [highlight] => 1 ) [2] => Array ( [age] => Freeze limit [shipments] => [orders] => [ifs] => [items] => 1 [highlight] => ) )
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/OV93b on line 55
Process exited with code 255.