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.4.9 - 8.4.13
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.5 - 8.3.26
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:
42.95 ms | 408 KiB | 5 Q