3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); $test = ["1", 1, 1.0, true]; $test = array_map(function(int $a){return $a;}, $test); var_dump($test);
based on FiVNu
Output for hhvm-3.21.3 - 3.22.0, 7.0.30 - 7.3.0rc3
array(4) { [0]=> int(1) [1]=> int(1) [2]=> int(1) [3]=> int(1) }
Output for hhvm-3.18.5
Fatal error: Uncaught TypeError: Argument 1 passed to __invoke() must be an instance of int, string given in /in/4b6CY:6 Stack trace: #0 (): Closure$() #1 /in/4b6CY(6): array_map() #2 {main}
Process exited with code 255.
Output for 5.6.30
Warning: Unsupported declare 'strict_types' in /in/4b6CY on line 2 Catchable fatal error: Argument 1 passed to {closure}() must be an instance of int, string given in /in/4b6CY on line 6
Process exited with code 255.