3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uid = 1; $radio_uid = substr(0,8,md5($uid)); echo md5($uid); echo "\n"; echo $radio_uid; echo "\n"; echo "d88cd95b-05e8-4fa6-a11d-31a80e17b992";
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.6
Fatal error: Uncaught TypeError: substr(): Argument #3 ($length) must be of type ?int, string given in /in/0uW2l:3 Stack trace: #0 /in/0uW2l(3): substr('0', 8, 'c4ca4238a0b9238...') #1 {main} thrown in /in/0uW2l on line 3
Process exited with code 255.
Output for 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Warning: substr() expects parameter 3 to be int, string given in /in/0uW2l on line 3 c4ca4238a0b923820dcc509a6f75849b d88cd95b-05e8-4fa6-a11d-31a80e17b992
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
Warning: substr() expects parameter 3 to be integer, string given in /in/0uW2l on line 3 c4ca4238a0b923820dcc509a6f75849b d88cd95b-05e8-4fa6-a11d-31a80e17b992
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: substr() expects parameter 3 to be long, string given in /in/0uW2l on line 3 c4ca4238a0b923820dcc509a6f75849b d88cd95b-05e8-4fa6-a11d-31a80e17b992

preferences:
171.91 ms | 402 KiB | 183 Q