3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function addition ($arg1, $arg2, $formatter) { $total = $arg1 + $arg2; return $formatter($total); } $int_total = addition(1, 2, 'intval'); $float_total = addition(1, 2, 'floatval'); var_dump(array($int_total, $float_total));
Output for 4.3.0 - 7.3.0rc4
array(2) { [0]=> int(3) [1]=> float(3) }