3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userPass = 'password'; $pass = md5($userPass); $options = ['cost' => 12]; if (password_needs_rehash($pass, PASSWORD_DEFAULT, $options)) { echo password_hash($userPass, PASSWORD_DEFAULT, $options); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/3u5gU
function name:  (null)
number of ops:  19
compiled vars:  !0 = $userPass, !1 = $pass, !2 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'password'
    4     1        INIT_FCALL                                               'md5'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    6     5        ASSIGN                                                   !2, <array>
    8     6        INIT_FCALL                                               'password_needs_rehash'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 '2y'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $7      
         11      > JMPZ                                                     $7, ->18
    9    12    >   INIT_FCALL                                               'password_hash'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 '2y'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $8      
         17        ECHO                                                     $8
   10    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.84 ms | 940 KiB | 20 Q