3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array( array( 'name' => 'Tanaka', 'skill' => 'A', ), array( 'name' => 'Yamada', 'skill' => 'B', ), array( 'name' => 'SAITO', 'skill' => 'C', ), array( 'name' => 'HIGASHIYAMA', 'skill' => 'D', ), array( 'name' => 'ARAKI', 'skill' => 'E', ), array( 'name' => 'YOSHIDA', 'skill' => 'F', ), ); $count = count($data); $table = call_user_func_array( 'array_merge', array_map( function ($group) { return call_user_func_array( 'array_map', array_merge(array(null), $group) ); }, array_chunk( $data + array_fill( 0, $count + $count % 4, array_fill(0, 2, '&nbsp;') ), 4 ) ) ); print_r($table);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [0] => Tanaka [1] => Yamada [2] => SAITO [3] => HIGASHIYAMA ) [1] => Array ( [0] => A [1] => B [2] => C [3] => D ) [2] => Array ( [0] => ARAKI [1] => YOSHIDA [2] => &nbsp; [3] => &nbsp; ) [3] => Array ( [0] => E [1] => F [2] => &nbsp; [3] => &nbsp; ) )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/m3G9Z on line 33
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/m3G9Z on line 33
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/m3G9Z on line 33
Process exited with code 255.