3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRandomString($n) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ=+/'; $randomString = ''; for ($i = 0; $i < $n; $i++) { $index = rand(0, strlen($characters) - 1); $randomString .= $characters[$index]; } return $randomString; } foreach (['foo', 'bar', getRandomString(100), getRandomString(2000), '', getRandomString(2000)] as $data) { $hash = base64_encode(hash('sha256', $data, TRUE)); print base64_encode(hash('sha256', $data, TRUE)) . ' : '; // Modify the hash so it's safe to use in URLs. $hashed = str_replace(['+', '/', '='], ['-', '_', ''], $hash); print $hashed . ' : '; print strlen($hashed) . PHP_EOL; }
Output for git.master_jit
LCa0a2j/xo/5m0U8HTBBNBNCLXBkg7+g+YpeiGJm564= : LCa0a2j_xo_5m0U8HTBBNBNCLXBkg7-g-YpeiGJm564 : 43 /N4rLtula/QIYB+3If6bXDONEO5CnqBPrlURto+/j7k= : _N4rLtula_QIYB-3If6bXDONEO5CnqBPrlURto-_j7k : 43 G5sVpH4zeBveVq7blxzjIPE4odXi1UBxnmU4Kiup3Kg= : G5sVpH4zeBveVq7blxzjIPE4odXi1UBxnmU4Kiup3Kg : 43 y/OMGMWyq0h5sMwBuqm566y1cpxBhnvDejkg8MqTsts= : y_OMGMWyq0h5sMwBuqm566y1cpxBhnvDejkg8MqTsts : 43 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= : 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU : 43 zyA4Np4VHwtGGvyYUNgxy5fmhASDIllJKfEbEyJ91B8= : zyA4Np4VHwtGGvyYUNgxy5fmhASDIllJKfEbEyJ91B8 : 43
Output for git.master
LCa0a2j/xo/5m0U8HTBBNBNCLXBkg7+g+YpeiGJm564= : LCa0a2j_xo_5m0U8HTBBNBNCLXBkg7-g-YpeiGJm564 : 43 /N4rLtula/QIYB+3If6bXDONEO5CnqBPrlURto+/j7k= : _N4rLtula_QIYB-3If6bXDONEO5CnqBPrlURto-_j7k : 43 Hv/fs4PsoRcwFvVqaIcm/OmBO0NOFe2r6s0rIrT6X/c= : Hv_fs4PsoRcwFvVqaIcm_OmBO0NOFe2r6s0rIrT6X_c : 43 N5+upYBOjAEf4LiVQif2qj+Xr1sJ28mCrX5gdRC5SvY= : N5-upYBOjAEf4LiVQif2qj-Xr1sJ28mCrX5gdRC5SvY : 43 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= : 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU : 43 HqToM3k+pU9/E/9r1+AlvwbnLKgTgC4uQeSWJTQdOSU= : HqToM3k-pU9_E_9r1-AlvwbnLKgTgC4uQeSWJTQdOSU : 43

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:
25.04 ms | 408 KiB | 5 Q