3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(check_input_data('wello', 'int')); var_dump(check_input_data('123groovybaby', 'int')); var_dump(check_input_data('0777777777', 'int')); $legit_id = "345\0groovybaby"; var_dump(check_input_data($legit_id, 'int')); function check_input_data($data, $type) { echo "testing data: ", (int)$data, "\n"; if (preg_match('/^[0-9]{1,10}$/D', $data) && $data < 2147483647) return true; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ICbcF
function name:  (null)
number of ops:  30
compiled vars:  !0 = $legit_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL_BY_NAME                                       'check_input_data'
          2        SEND_VAL_EX                                              'wello'
          3        SEND_VAL_EX                                              'int'
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
    4     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL_BY_NAME                                       'check_input_data'
          9        SEND_VAL_EX                                              '123groovybaby'
         10        SEND_VAL_EX                                              'int'
         11        DO_FCALL                                      0  $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                                 
    5    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL_BY_NAME                                       'check_input_data'
         16        SEND_VAL_EX                                              '0777777777'
         17        SEND_VAL_EX                                              'int'
         18        DO_FCALL                                      0  $5      
         19        SEND_VAR                                                 $5
         20        DO_ICALL                                                 
    6    21        ASSIGN                                                   !0, '345%00groovybaby'
    7    22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL_BY_NAME                                       'check_input_data'
         24        SEND_VAR_EX                                              !0
         25        SEND_VAL_EX                                              'int'
         26        DO_FCALL                                      0  $8      
         27        SEND_VAR                                                 $8
         28        DO_ICALL                                                 
   14    29      > RETURN                                                   1

Function check_input_data:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/ICbcF
function name:  check_input_data
number of ops:  16
compiled vars:  !0 = $data, !1 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        ECHO                                                     'testing+data%3A+'
          3        CAST                                          4  ~2      !0
          4        ECHO                                                     ~2
          5        ECHO                                                     '%0A'
   12     6        INIT_FCALL                                               'preg_match'
          7        SEND_VAL                                                 '%2F%5E%5B0-9%5D%7B1%2C10%7D%24%2FD'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $3      
         10      > JMPZ_EX                                          ~4      $3, ->13
         11    >   IS_SMALLER                                       ~5      !0, 2147483647
         12        BOOL                                             ~4      ~5
         13    > > JMPZ                                                     ~4, ->15
   13    14    > > RETURN                                                   <true>
   14    15    > > RETURN                                                   null

End of function check_input_data

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.8 ms | 1392 KiB | 17 Q