3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s=''; $s++; var_dump($s); var_dump(str_increment($s)); var_dump(str_increment('')); var_dump(str_decrement(''));
Output for 8.5.0
Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/8jhPc on line 4 string(1) "1" string(1) "2" Fatal error: Uncaught ValueError: str_increment(): Argument #1 ($string) must not be empty in /in/8jhPc:7 Stack trace: #0 /in/8jhPc(7): str_increment('') #1 {main} thrown in /in/8jhPc on line 7
Process exited with code 255.
Output for 8.4.9 - 8.4.15
Deprecated: Increment on non-alphanumeric string is deprecated in /in/8jhPc on line 4 string(1) "1" string(1) "2" Fatal error: Uncaught ValueError: str_increment(): Argument #1 ($string) must not be empty in /in/8jhPc:7 Stack trace: #0 /in/8jhPc(7): str_increment('') #1 {main} thrown in /in/8jhPc on line 7
Process exited with code 255.
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.
Output for 8.3.5 - 8.3.27
Deprecated: Increment on non-alphanumeric string is deprecated in /in/8jhPc on line 4 string(1) "1" string(1) "2" Fatal error: Uncaught ValueError: str_increment(): Argument #1 ($string) cannot be empty in /in/8jhPc:7 Stack trace: #0 /in/8jhPc(7): str_increment('') #1 {main} thrown in /in/8jhPc on line 7
Process exited with code 255.
Output for 8.2.29
string(1) "1" Fatal error: Uncaught Error: Call to undefined function str_increment() in /in/8jhPc:6 Stack trace: #0 {main} thrown in /in/8jhPc on line 6
Process exited with code 255.

preferences:
55.89 ms | 412 KiB | 5 Q