3v4l.org

run code in 300+ 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 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/TjOJV
function name:  valid_password
number of ops:  26
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    >   INIT_FCALL                                               'trim'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !0, $4
    6    10        INIT_FCALL                                               'mb_strlen'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 'utf-8'
         13        DO_ICALL                                         $6      
         14        IS_SMALLER                                       ~7      $6, !1
         15      > JMPNZ_EX                                         ~7      ~7, ->22
         16    >   INIT_FCALL                                               'mb_strlen'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 'utf-8'
         19        DO_ICALL                                         $8      
         20        IS_SMALLER                                       ~9      !2, $8
         21        BOOL                                             ~7      ~9
         22    > > JMPZ                                                     ~7, ->24
         23    > > RETURN                                                   <false>
    7    24    > > RETURN                                                   !0
    8    25*     > RETURN                                                   null

End of function valid_password

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.49 ms | 1403 KiB | 18 Q