3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function multiply( $a, $b): float { return (double)$a * (double)$b; } $six = multiply(2, 3); echo gettype($six);
based on gqEH9
Output for 7.0.28 - 7.3.0rc3
double
Output for 5.6.38
Warning: Unsupported declare 'strict_types' in /in/tIVi8 on line 2 Parse error: syntax error, unexpected ':', expecting '{' in /in/tIVi8 on line 3
Process exited with code 255.