3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Everything you enter here will be executed by our servers. Try it! function reduce_table_size($value, $item) { return $value + $item['index_length'] + $item['data_length']; } $tables = array( 0 => array('index_length' => 1, 'data_length' => 2), 1 => array('index_length' => 3, 'data_length' => 4) ); $size = array_reduce($tables, 'reduce_table_size'); echo $size;
Output for 4.3.3 - 7.1.0
10
Output for 4.3.2
<br /> <b>Fatal error</b>: Unsupported operand types in <b>/in/YFkJj</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Unsupported operand types in <b>/in/YFkJj</b> on line <b>5</b><br />