3v4l.org

run code in 300+ PHP versions simultaneously
<?php function startsWith($haystack, $needle) { return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE; } function find_dec_prefix($str) { $i = 0; for(;;$i++) { if ($i == 0) $newstr = $str; else $newstr = $str . $i; $hash = sha1($newstr); if($hash[0] == '0' && $hash[1] == 'e') { // echo "Found it: [" . $newstr . "] " . $hash . "\n"; // echo "subs: " . substr($hash, 2) . "\n"; if(!preg_match("/[a-f]/", substr($hash, 2))) { echo "doesn't contain a-f: $hash\n"; return $newstr; } } } } $pass1 = find_dec_prefix("aaroZmOk"); $pass2 = find_dec_prefix("aaK1STfY"); var_dump(sha1($pass1) == sha1($pass2)); echo(sha1('aaroZmOk') . " == " . sha1('aaK1STfY') . "\n"); $pass3 = find_dec_prefix("suPERSecretPasSw0rD"); $pass4 = find_dec_prefix("omgDONTcollidePLEASE"); var_dump(sha1($pass3) == sha1($pass4)); echo(sha1('aaroZmOk') . " == " . sha1('aaK1STfY') . "\n");
Output for git.master, git.master_jit, rfc.property-hooks
doesn't contain a-f: 0e66507019969427134894567494305185566735 doesn't contain a-f: 0e76658526655756207688271159624026011393 bool(true) 0e66507019969427134894567494305185566735 == 0e76658526655756207688271159624026011393
Process exited with code 137.

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:
44.75 ms | 401 KiB | 8 Q