3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pw = "\x00\x30"; $hash = password_hash($pw, PASSWORD_DEFAULT); assert(password_verify(password: 'wrong', hash: $hash) === false, 'Incorect password should not verify'); assert(password_verify(password: '', hash: $hash) === false, 'Blank password should not verify'); assert(password_verify(password: $pw, hash: $hash) === true, 'Correct password should verify'); assert(password_verify(password: strrev($pw), hash: $hash) === false, 'Reversed correct password not should verify');
Output for git.master_jit, git.master
Fatal error: Uncaught ValueError: Bcrypt password must not contain null character in /in/Z0pcl:5 Stack trace: #0 /in/Z0pcl(5): password_hash(Object(SensitiveParameterValue), '2y') #1 {main} thrown in /in/Z0pcl on line 5
Process exited with code 255.
Output for rfc.property-hooks
Fatal error: Uncaught AssertionError: Blank password should not verify in /in/Z0pcl:8 Stack trace: #0 /in/Z0pcl(8): assert(false, 'Blank password ...') #1 {main} thrown in /in/Z0pcl on line 8
Process exited with code 255.

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:
42.26 ms | 406 KiB | 5 Q