3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = base64_encode(random_bytes(54)); // 72 chars $b = $a . random_bytes(33); // Same 72 character prefix, with junk added after the end $hash = password_hash($a, PASSWORD_BCRYPT); // Since $b has junk added to the end, we'd expect this to return // bool(false) var_dump(password_verify($b, $hash));
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.32, 7.3.0 - 7.3.20, 7.4.0 - 7.4.8
bool(true)
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Fatal error: Call to undefined function random_bytes() in /in/AsiTa on line 3
Process exited with code 255.

preferences:
66.35 ms | 407 KiB | 5 Q