3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array( "a" => [1, 2, 3], "b" => [4], ); var_dump(array_reduce($array, function(int $carry, array $item) { return $carry + count($item); }, 0));
based on OOS3m
Output for hhvm-3.15.4, 7.0.0 - 7.3.0rc3
int(4)
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to {closure}() must be an instance of int, integer given in /in/ZtBqe on line 8
Process exited with code 255.