3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(strlen(0)); var_dump(strlen(0.0)); var_dump(strlen(null)); var_dump(strlen(false)); var_dump(strlen([]));
Output for 8.1.18 - 8.1.30, 8.2.5 - 8.2.24, 8.3.0 - 8.3.12
int(1) int(1) Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/LqVmG on line 4 int(0) int(0) Fatal error: Uncaught TypeError: strlen(): Argument #1 ($string) must be of type string, array given in /in/LqVmG:6 Stack trace: #0 {main} thrown in /in/LqVmG on line 6
Process exited with code 255.
Output for 8.1.0 - 8.1.17, 8.2.0 - 8.2.4
int(1) int(1) Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/LqVmG on line 4 int(0) int(0) Fatal error: Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in /in/LqVmG:6 Stack trace: #0 {main} thrown in /in/LqVmG on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30
int(1) int(1) int(0) int(0) Fatal error: Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in /in/LqVmG:6 Stack trace: #0 {main} thrown in /in/LqVmG on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.5 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
int(1) int(1) int(0) int(0) Warning: strlen() expects parameter 1 to be string, array given in /in/LqVmG on line 6 NULL

preferences:
77.97 ms | 411 KiB | 5 Q