3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getInstagramUrlFromMediaId($media_id) { $alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; $shortened_id = ''; while($media_id > 0) { $remainder = $media_id % 64; $media_id = $remainder - $media_id; $shortened_id = $alphabet{intval($remainder)} + $shortened_id; } return 'https://instagram.com/p/' + $shortened_id + '/'; } print_r(getInstagramUrlFromMediaId(179866));
based on vuGuI
Output for 7.1.0 - 7.3.0alpha1
Warning: A non-numeric value encountered in /in/WXKos on line 10 Warning: A non-numeric value encountered in /in/WXKos on line 10 Warning: A non-numeric value encountered in /in/WXKos on line 13 Warning: A non-numeric value encountered in /in/WXKos on line 13 0
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0
0