3v4l.org

run code in 300+ PHP versions simultaneously
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output for 8.4.1 - 8.4.5
Deprecated: {closure:/in/pnXfM:9}(): Implicitly marking parameter $str as nullable is deprecated, the explicit nullable type must be used instead in /in/pnXfM on line 9 parameter allowsNull isOptional getDefaultValue getType $str true false throws ReflectionException null $str = 'hello' true true hello null string $str false false throws ReflectionException ReflectionNamedType ?string $str = NULL true true ReflectionNamedType ?string $str true false throws ReflectionException ReflectionNamedType ?Database $db true false throws ReflectionException ReflectionNamedType Database $db = new \Database() false true Database Object() ReflectionNamedType ?string $str true false throws ReflectionException ReflectionNamedType string $str = 'hello' false true hello ReflectionNamedType ?string $str = 'hello' true true hello ReflectionNamedType string|int $str false false throws ReflectionException ReflectionUnionType ?string $str = NULL true true ReflectionNamedType ?string $str = 'hello' true true hello ReflectionNamedType
Output for 8.1.30 - 8.1.32, 8.2.10 - 8.2.28, 8.3.0 - 8.3.19
parameter allowsNull isOptional getDefaultValue getType $str true false throws ReflectionException null $str = 'hello' true true hello null string $str false false throws ReflectionException ReflectionNamedType ?string $str = NULL true true ReflectionNamedType ?string $str true false throws ReflectionException ReflectionNamedType ?Database $db true false throws ReflectionException ReflectionNamedType Database $db = new \Database() false true Database Object() ReflectionNamedType ?string $str true false throws ReflectionException ReflectionNamedType string $str = 'hello' false true hello ReflectionNamedType ?string $str = 'hello' true true hello ReflectionNamedType string|int $str false false throws ReflectionException ReflectionUnionType ?string $str = NULL true true ReflectionNamedType ?string $str = 'hello' true true hello ReflectionNamedType
Output for 8.0.11
Fatal error: Constant expression contains invalid operations in /in/pnXfM on line 12
Process exited with code 255.
Output for 7.1.6, 7.4.33
Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /in/pnXfM on line 13
Process exited with code 255.
Output for 5.6.40
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /in/pnXfM on line 10
Process exited with code 255.
Output for 5.4.43, 5.5.11
Parse error: syntax error, unexpected '?', expecting '&' or variable (T_VARIABLE) in /in/pnXfM on line 10
Process exited with code 255.

preferences:
68.18 ms | 419 KiB | 5 Q