3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Coercive mode function sumOfInts(int $ints) { return array_sum($ints); } var_dump(sumOfInts(2, '3', 4.1));
based on lgPR0
Output for 7.0.0 - 7.2.0
Warning: array_sum() expects parameter 1 to be array, integer given in /in/LU4UD on line 6 NULL
Output for 5.3.20 - 5.6.28
Catchable fatal error: Argument 1 passed to sumOfInts() must be an instance of int, integer given, called in /in/LU4UD on line 9 and defined in /in/LU4UD on line 4
Process exited with code 255.