3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = array("A","B","C","D"); $childList = $list; foreach ( $childList as &$var ) { cleanChild($childList, $list); $childList = $list; } echo "\n"; function cleanChild(&$childList, &$list) { foreach ($childList as $key => $childVar) { if ($childVar == 'B') { unset($list[$key]); } } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/fL505
function name:  (null)
number of ops:  13
compiled vars:  !0 = $list, !1 = $childList, !2 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, !0
    6     2      > FE_RESET_RW                                      $5      !1, ->10
          3    > > FE_FETCH_RW                                              $5, !2, ->10
    7     4    >   INIT_FCALL_BY_NAME                                       'cleanChild'
          5        SEND_VAR_EX                                              !1
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
    8     8        ASSIGN                                                   !1, !0
    6     9      > JMP                                                      ->3
         10    >   FE_FREE                                                  $5
   11    11        ECHO                                                     '%0A'
   21    12      > RETURN                                                   1

Function cleanchild:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/fL505
function name:  cleanChild
number of ops:  11
compiled vars:  !0 = $childList, !1 = $list, !2 = $childVar, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2      > FE_RESET_R                                       $4      !0, ->9
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->9
          4    >   ASSIGN                                                   !3, ~5
   15     5        IS_EQUAL                                                 !2, 'B'
          6      > JMPZ                                                     ~7, ->8
   16     7    >   UNSET_DIM                                                !1, !3
   14     8    > > JMP                                                      ->3
          9    >   FE_FREE                                                  $4
   19    10      > RETURN                                                   null

End of function cleanchild

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.44 ms | 1395 KiB | 13 Q