3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function someFloat(\float $value) { echo "(" . gettype($value) . ") " . $value; } someFloat(1.1);
based on bknfY
Output for 7.0.1 - 7.2.12
Fatal error: Scalar type declaration 'float' must be unqualified in /in/X0fRF on line 3
Process exited with code 255.
Output for 7.0.0
(double) 1.1
Output for hhvm-3.22.0
Fatal error: Uncaught TypeError: Argument 1 passed to someFloat() must be an instance of float, double given in /in/X0fRF:-1 Stack trace: #0 /in/X0fRF(-1): someFloat() #1 {main}
Process exited with code 255.
Output for hhvm-3.11.1 - 3.21.3
Fatal error: Uncaught TypeError: Argument 1 passed to someFloat() must be an instance of float, double given in /in/X0fRF:5 Stack trace: #0 /in/X0fRF(7): someFloat() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Catchable fatal error: Argument 1 passed to someFloat() must be an instance of float, double given in /in/X0fRF on line 5
Process exited with code 255.
Output for 5.3.19 - 5.6.38
Catchable fatal error: Argument 1 passed to someFloat() must be an instance of float, double given, called in /in/X0fRF on line 7 and defined in /in/X0fRF on line 3
Process exited with code 255.