3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filterKeys = array( 'ticket', 'password', 'pass_word', 'passcode', 'pass_code', 'paypassword', 'pay_password' ); function filterKeysCallback(array &$list, &$filterKeys) { foreach($list as $key => &$item) { if (is_array($item)) { filterKeysCallback($item, $filterKeys); continue; } if (in_array($key, $filterKeys)) { var_dump($key, $filterKeys, in_array($key, $filterKeys), array_search($key, $filterKeys)); exit(); $item = str_repeat('x', strlen($item)); } } unset($item); }; $params = array( 'get' => array( 0 => '1231', 1 => '456' ) ); filterKeysCallback($params['get'], $filterKeys);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lQItB
function name:  (null)
number of ops:  8
compiled vars:  !0 = $filterKeys, !1 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   29     1        ASSIGN                                                   !1, <array>
   37     2        INIT_FCALL                                               'filterkeyscallback'
          3        FETCH_DIM_W                                      $4      !1, 'get'
          4        SEND_REF                                                 $4
          5        SEND_REF                                                 !0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function filterkeyscallback:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 39
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 39
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 38
Branch analysis from position: 17
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/lQItB
function name:  filterKeysCallback
number of ops:  42
compiled vars:  !0 = $list, !1 = $filterKeys, !2 = $item, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2      > FE_RESET_RW                                      $4      !0, ->39
          3    > > FE_FETCH_RW                                      ~5      $4, !2, ->39
          4    >   ASSIGN                                                   !3, ~5
   16     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~7, ->12
   17     7    >   INIT_FCALL_BY_NAME                                       'filterKeysCallback'
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
   18    11      > JMP                                                      ->3
   21    12    >   INIT_FCALL                                               'in_array'
         13        SEND_VAR                                                 !3
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $9      
         16      > JMPZ                                                     $9, ->38
   22    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !3
         19        SEND_VAR                                                 !1
         20        INIT_FCALL                                               'in_array'
         21        SEND_VAR                                                 !3
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $10     
         24        SEND_VAR                                                 $10
         25        INIT_FCALL                                               'array_search'
         26        SEND_VAR                                                 !3
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                         $11     
         29        SEND_VAR                                                 $11
         30        DO_ICALL                                                 
         31      > EXIT                                                     
   23    32*       INIT_FCALL                                               'str_repeat'
         33*       SEND_VAL                                                 'x'
         34*       STRLEN                                           ~13     !2
         35*       SEND_VAL                                                 ~13
         36*       DO_ICALL                                         $14     
         37*       ASSIGN                                                   !2, $14
   14    38    > > JMP                                                      ->3
         39    >   FE_FREE                                                  $4
   26    40        UNSET_CV                                                 !2
   27    41      > RETURN                                                   null

End of function filterkeyscallback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.15 ms | 1403 KiB | 22 Q