3v4l.org

run code in 500+ PHP versions simultaneously
<?php function valid_password($val, $min=8, $max = 255){ if(is_array($val)) return false; $val=trim($val); if(mb_strlen($val, 'utf-8')<$min OR mb_strlen($val, 'utf-8')>$max) return false; return $val; } $pass = new \Exception('test'); echo 'Fake password is valid: ' . (!is_bool(valid_password($pass)) ? 'yes': 'no');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TjOJV
function name:  (null)
number of ops:  16
compiled vars:  !0 = $pass
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $1      'Exception'
          1        SEND_VAL_EX                                                  'test'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   12     4        INIT_FCALL                                                   'valid_password'
          5        SEND_VAR                                                     !0
          6        DO_FCALL                                          0  $4      
          7        TYPE_CHECK                                       12  ~5      $4
          8        BOOL_NOT                                             ~6      ~5
          9      > JMPZ                                                         ~6, ->12
         10    >   QM_ASSIGN                                            ~7      'yes'
         11      > JMP                                                          ->13
         12    >   QM_ASSIGN                                            ~7      'no'
         13    >   CONCAT                                               ~8      'Fake+password+is+valid%3A+', ~7
         14        ECHO                                                         ~8
         15      > RETURN                                                       1

Function valid_password:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/TjOJV
function name:  valid_password
number of ops:  24
compiled vars:  !0 = $val, !1 = $min, !2 = $max
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      8
          2        RECV_INIT                                            !2      255
    4     3        TYPE_CHECK                                      128          !0
          4      > JMPZ                                                         ~3, ->6
          5    > > RETURN                                                       <false>
    5     6    >   FRAMELESS_ICALL_1                trim                ~4      !0
          7        ASSIGN                                                       !0, ~4
    6     8        INIT_FCALL                                                   'mb_strlen'
          9        SEND_VAR                                                     !0
         10        SEND_VAL                                                     'utf-8'
         11        DO_ICALL                                             $6      
         12        IS_SMALLER                                           ~7      $6, !1
         13      > JMPNZ_EX                                             ~7      ~7, ->20
         14    >   INIT_FCALL                                                   'mb_strlen'
         15        SEND_VAR                                                     !0
         16        SEND_VAL                                                     'utf-8'
         17        DO_ICALL                                             $8      
         18        IS_SMALLER                                           ~9      !2, $8
         19        BOOL                                                 ~7      ~9
         20    > > JMPZ                                                         ~7, ->22
         21    > > RETURN                                                       <false>
    7    22    > > RETURN                                                       !0
    8    23*     > RETURN                                                       null

End of function valid_password

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.39 ms | 2117 KiB | 15 Q