3v4l.org

run code in 300+ PHP versions simultaneously
<?php class base58 { static public $alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"; public static function encode($int) { $base58_string = ""; $base = strlen(self::$alphabet); while($int >= $base) { $div = floor($int / $base); $mod = ($int - ($base * $div)); // php's % is broke with >32bit int on 32bit proc $base58_string = self::$alphabet{$mod} . $base58_string; $int = $div; } if($int) $base58_string = self::$alphabet{$int} . $base58_string; return $base58_string; } public static function decode($base58) { $int_val = 0; for($i=strlen($base58)-1,$j=1,$base=strlen(self::$alphabet);$i>=0;$i--,$j*=$base) { $int_val += $j * strpos(self::$alphabet, $base58{$i}); } return $int_val; } } for($i = 0; $i < 1000; $i++) { echo "http://flic.kr/p/" . base58::encode(3392387861) . "\n"; }
Output for git.master, git.master_jit
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/4oeDW on line 12
Process exited with code 255.
Output for rfc.property-hooks
Parse error: syntax error, unexpected token "{" in /in/4oeDW on line 12
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:
42 ms | 401 KiB | 8 Q