3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tmp = "2_【23区・千葉】"; $tmp = mb_strimwidth($tmp , strlen( $tmp ) *(-1) + 3 , strlen($tmp ) - 3 ); echo $tmp ;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught ValueError: mb_strimwidth(): Argument #2 ($start) is out of range in /in/dI1mn:4 Stack trace: #0 /in/dI1mn(4): mb_strimwidth('2_\xE3\x80\x9023\xE5\x8C\xBA\xE3\x83\xBB\xE5\x8D...', -19, 19) #1 {main} thrown in /in/dI1mn on line 4
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught ValueError: mb_strimwidth(): Argument #2 ($start) is out of range in /in/dI1mn:4 Stack trace: #0 /in/dI1mn(4): mb_strimwidth('2_\xE3\x80\x9023\xE5\x8C\xBA\xE3\x83\xBB\xE5\x8D...', -19, 19) #1 {main} thrown in /in/dI1mn on line 4
Process exited with code 255.
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: mb_strimwidth(): Start position is out of range in /in/dI1mn on line 4

preferences:
236.6 ms | 402 KiB | 291 Q