3v4l.org

run code in 300+ PHP versions simultaneously
<?php function from62to10($num) { $from = 62; $num = strval($num); $dict = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $len = strlen($num); $dec = 0; for($i = 0; $i < $len; $i++) { $pos = strpos($dict, $num[$i]); $dec = bcadd(bcmul(bcpow($from, $len - $i - 1), $pos), $dec); } return $dec; } function decode($url) { $file = basename($url,'.jpg'); $code = substr($file, 0, 8); if (substr($code, 0, 2) == '00') { return from62to10($code); } else { return hexdec($code); } } $url = 'http://ww3.sinaimg.cn/large/0060lm7Tly1fj8dcbq7bcj30f0076jr7.jpg'; $weibo = 'http://weibo.com/u/' . decode($url); echo $weibo;
Output for 7.0.0 - 7.0.23, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
http://weibo.com/u/5501886937
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 http://weibo.com/u/5501886937
Output for 7.3.32 - 7.3.33, 7.4.33, 8.0.13
Fatal error: Uncaught Error: Call to undefined function bcadd() in /in/2J3FH:13 Stack trace: #0 /in/2J3FH(22): from62to10('0060lm7T') #1 /in/2J3FH(30): decode('http://ww3.sina...') #2 {main} thrown in /in/2J3FH on line 13
Process exited with code 255.

preferences:
157.89 ms | 402 KiB | 177 Q