3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //declare(strict_types=1); function sum($a, $b): float { return $a + $b; } var_dump(sum(1, 2)); var_dump(sum(1, 2.5)); ?>
based on oIMAW
Output for 7.0.0 - 7.2.0
float(3) float(3.5)
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/SiqOt on line 4
Process exited with code 255.