3v4l.org

run code in 300+ PHP versions simultaneously
<?php const INT_CONST = 1; const FLOAT_CONST = 1.1; const STRING_CONST = ""; const BOOL_CONST = false; const ARRAY_CONST = []; function int_int(int $p = INT_CONST) {} // no error function int_string(int $p = STRING_CONST) {} // ERROR function int_bool(int $p = BOOL_CONST) {} // no error function int_float(int $p = FLOAT_CONST) {} // no error function int_array(int $p = ARRAY_CONST) {} // ERROR function float_int(float $p = INT_CONST) {} // no error function float_string(float $p = STRING_CONST) {} // ERROR function float_bool(float $p = BOOL_CONST) {} // no error function float_float(float $p = FLOAT_CONST) {} // no error function float_array(float $p = ARRAY_CONST) {} // ERROR function string_int(string $p = INT_CONST) {} // no error function string_string(string $p = STRING_CONST) {} // no error function string_bool(string $p = BOOL_CONST) {} // no error function string_float(string $p = FLOAT_CONST) {} // no error function string_array(string $p = ARRAY_CONST) {} // ERROR function bool_int(bool $p = INT_CONST) {} // no error function bool_string(bool $p = STRING_CONST) {} // no error function bool_bool(bool $p = BOOL_CONST) {} // no error function bool_float(bool $p = FLOAT_CONST) {} // no error function bool_array(bool $p = ARRAY_CONST) {} // ERROR function array_int(array $p = INT_CONST) {} // no error function array_string(array $p = STRING_CONST) {} // no error function array_bool(array $p = BOOL_CONST) {} // no error function array_float(array $p = FLOAT_CONST) {} // no error function array_array(array $p = ARRAY_CONST) {} // ERROR //array_int(); //array_string(); //array_bool(); array_float(); array_array();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_float(): Argument #1 ($p) must be of type array, float given, called in /in/KFUbf on line 42 and defined in /in/KFUbf:36 Stack trace: #0 /in/KFUbf(42): array_float() #1 {main} thrown in /in/KFUbf on line 36
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
21.66 ms | 406 KiB | 5 Q