3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $2a$12$BMxrzFUgKhjg3KYLUxQH7.ewjXzBUiy7MmIICALXHlOYudsAFQnGa $hash = crypt('falcon', '$2a$12$BMxrzFUgKhjg3KYLUxQH7K'); var_dump($hash == crypt('falcon', $hash)); var_dump($hash == '$2a$12$BMxrzFUgKhjg3KYLUxQH7.ewjXzBUiy7MmIICALXHlOYudsAFQnGa'); /* $salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22); // 2a is the bcrypt algorithm selector, see http://php.net/crypt // 12 is the workload factor (around 300ms on my Core i7 machine), see http://php.net/crypt echo $hash = crypt('falcon', '$2a$12$' . $salt); var_dump('$2a$12$' . $salt); // we can now use the generated hash as the argument to crypt(), since it too will contain $a2$12$... with a variation of the hash. No need to store the salt anymore, just the hash is enough! var_dump($hash == crypt('foo', $hash)); // true var_dump($hash == crypt('falcon', $hash)); // false */
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(true)

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