3v4l.org

run code in 300+ PHP versions simultaneously
<?php $legit_id = pack("c3", ord('5'), 0, -34); var_dump($legit_id); var_dump(check_input_data($legit_id, 'int')); function check_input_data($data, $type) { //if (preg_match('/^[0-9]{1,10}$/D', $data) && $data < 2147483647) if (preg_match('/^[\w]{1,30}$/D', $data)) return true; return false; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A54Yq
function name:  (null)
number of ops:  18
compiled vars:  !0 = $legit_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'pack'
          1        SEND_VAL                                                 'c3'
          2        SEND_VAL                                                 53
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 -34
          5        DO_ICALL                                         $1      
          6        ASSIGN                                                   !0, $1
    4     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    5    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL_BY_NAME                                       'check_input_data'
         12        SEND_VAR_EX                                              !0
         13        SEND_VAL_EX                                              'int'
         14        DO_FCALL                                      0  $4      
         15        SEND_VAR                                                 $4
         16        DO_ICALL                                                 
   15    17      > RETURN                                                   1

Function check_input_data:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A54Yq
function name:  check_input_data
number of ops:  10
compiled vars:  !0 = $data, !1 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%5E%5B%5Cw%5D%7B1%2C30%7D%24%2FD'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->8
   12     7    > > RETURN                                                   <true>
   14     8    > > RETURN                                                   <false>
   15     9*     > RETURN                                                   null

End of function check_input_data

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.69 ms | 1396 KiB | 19 Q