3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $checksum = crc32("The quick brown fox jumped over the lazy dog."); $outstring = ''; $l = strlen($data); for ($i = 0; $i < $l; $i += 8) { $chunk = substr($data, $i, 8); $outlen = ceil((strlen($chunk) * 8)/6); //8bit/char in, 6bits/char out, round up $x = bin2hex($chunk); //gmp won't convert from binary, so go via hex $w = gmp_strval(gmp_init(ltrim($x, '0'), 16), 62); //gmp doesn't like leading 0s $pad = str_pad($w, $outlen, '0', STR_PAD_LEFT); $outstring .= $pad; } echo $outstring; printf("%u\n", $checksum);
based on RS6QA
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Notice: Undefined variable: data in /in/CoY5T on line 6 2191738434