3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getShortUrl(int $id) { $chars = "123456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ"; $length = strlen($chars); $id = intval($id); if ($id < 1) { return 0; } $code = ""; while ($id > $length - 1) { $fmod =intval(fmod($id, $length)); $code =$chars[$fmod].$code; $id = floor($id / $length); } $code = $chars[intval($id)] . $code; return $code; } $short_url=getShortUrl(14992139347739999999999); echo "sinadme.com/".$short_url;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: getShortUrl(): Argument #1 ($id) must be of type int, float given, called in /in/ftjTp on line 20 and defined in /in/ftjTp:2 Stack trace: #0 /in/ftjTp(20): getShortUrl(1.499213934774E+22) #1 {main} thrown in /in/ftjTp on line 2
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
59.32 ms | 401 KiB | 8 Q