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');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z0pcl
function name:  (null)
number of ops:  50
compiled vars:  !0 = $pw, !1 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%000'
    5     1        INIT_FCALL                                               'password_hash'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '2y'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    7     6        ASSERT_CHECK                                             
          7        INIT_FCALL                                               'assert'
          8        INIT_FCALL                                               'password_verify'
          9        SEND_VAL                                                 'wrong'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        TYPE_CHECK                                    4  ~6      $5
         13        SEND_VAL                                                 ~6
         14        SEND_VAL                                                 'Incorect+password+should+not+verify'
         15        DO_ICALL                                                 
    8    16        ASSERT_CHECK                                             
         17        INIT_FCALL                                               'assert'
         18        INIT_FCALL                                               'password_verify'
         19        SEND_VAL                                                 ''
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $8      
         22        TYPE_CHECK                                    4  ~9      $8
         23        SEND_VAL                                                 ~9
         24        SEND_VAL                                                 'Blank+password+should+not+verify'
         25        DO_ICALL                                                 
    9    26        ASSERT_CHECK                                             
         27        INIT_FCALL                                               'assert'
         28        INIT_FCALL                                               'password_verify'
         29        SEND_VAR                                                 !0
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $11     
         32        TYPE_CHECK                                    8  ~12     $11
         33        SEND_VAL                                                 ~12
         34        SEND_VAL                                                 'Correct+password+should+verify'
         35        DO_ICALL                                                 
   10    36        ASSERT_CHECK                                             
         37        INIT_FCALL                                               'assert'
         38        INIT_FCALL                                               'password_verify'
         39        INIT_FCALL                                               'strrev'
         40        SEND_VAR                                                 !0
         41        DO_ICALL                                         $14     
         42        SEND_VAR                                                 $14
         43        SEND_VAR                                                 !1
         44        DO_ICALL                                         $15     
         45        TYPE_CHECK                                    4  ~16     $15
         46        SEND_VAL                                                 ~16
         47        SEND_VAL                                                 'Reversed+correct+password+not+should+verify'
         48        DO_ICALL                                                 
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.76 ms | 1006 KiB | 17 Q