3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $items=array( array( 'orderno' => '150228085016', 'delivery_time' => '1425124096', 'create_time' => '1425174370'), array ( 'orderno' => '150228084786', 'delivery_time' => '1425124096', 'create_time' => '1425174374'), array ( 'orderno' => '150228090539', 'delivery_time' => '1425123584', 'create_time' => '1425174387') ); $items = array_map(function ($item) { $item['delivery_time'] = date('Y-m-d', $item['delivery_time']); $item['create_time'] = date('Y-m-d', $item['create_time']); return $item; },$items); print_r( $items); var_dump(mb_detect_encoding('哈哈') == 'UTF-8'); function insertAt($items, $index, $value) { array_splice($items, $index, 0, $value); return $items; } $items= ['苹果','橘子','梨','菠萝','香蕉','火龙果'] ; $items=insertAt($items, 2 , '橙子'); print_r( $items);
Output for 5.4.0 - 7.3.0rc4
Array ( [0] => Array ( [orderno] => 150228085016 [delivery_time] => 2015-02-28 [create_time] => 2015-03-01 ) [1] => Array ( [orderno] => 150228084786 [delivery_time] => 2015-02-28 [create_time] => 2015-03-01 ) [2] => Array ( [orderno] => 150228090539 [delivery_time] => 2015-02-28 [create_time] => 2015-03-01 ) ) bool(true) Array ( [0] => 苹果 [1] => 橘子 [2] => 橙子 [3] => 梨 [4] => 菠萝 [5] => 香蕉 [6] => 火龙果 )
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/JoVcr on line 34
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/JoVcr on line 18
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/JoVcr on line 18
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/JoVcr on line 18
Process exited with code 255.