3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('a','b','c','d','x','u','xx'); $array2 = array('e','f','g','h','s','d','t'); $array3 = array('i','j','k','l'); $data = [$array1, $array2, $array3]; $newArray = array(); $mi = new MultipleIterator(MultipleIterator::MIT_NEED_ANY); $mi->attachIterator(new ArrayIterator($data[0])); $mi->attachIterator(new ArrayIterator($data[1])); $mi->attachIterator(new ArrayIterator($data[2])); foreach($mi as $details) { $newArray = array_merge( $newArray, array_filter($details) ); } var_dump($newArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 47
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 47
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/SUCTa
function name:  (null)
number of ops:  52
compiled vars:  !0 = $array1, !1 = $array2, !2 = $array3, !3 = $data, !4 = $newArray, !5 = $mi, !6 = $details
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3        INIT_ARRAY                                       ~10     !0
          4        ADD_ARRAY_ELEMENT                                ~10     !1
          5        ADD_ARRAY_ELEMENT                                ~10     !2
          6        ASSIGN                                                   !3, ~10
    8     7        ASSIGN                                                   !4, <array>
    9     8        NEW                                              $13     'MultipleIterator'
          9        SEND_VAL_EX                                              0
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !5, $13
   10    12        INIT_METHOD_CALL                                         !5, 'attachIterator'
         13        NEW                                              $16     'ArrayIterator'
         14        CHECK_FUNC_ARG                                           
         15        FETCH_DIM_FUNC_ARG                               $17     !3, 0
         16        SEND_FUNC_ARG                                            $17
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $16
         19        DO_FCALL                                      0          
   11    20        INIT_METHOD_CALL                                         !5, 'attachIterator'
         21        NEW                                              $20     'ArrayIterator'
         22        CHECK_FUNC_ARG                                           
         23        FETCH_DIM_FUNC_ARG                               $21     !3, 1
         24        SEND_FUNC_ARG                                            $21
         25        DO_FCALL                                      0          
         26        SEND_VAR_NO_REF_EX                                       $20
         27        DO_FCALL                                      0          
   12    28        INIT_METHOD_CALL                                         !5, 'attachIterator'
         29        NEW                                              $24     'ArrayIterator'
         30        CHECK_FUNC_ARG                                           
         31        FETCH_DIM_FUNC_ARG                               $25     !3, 2
         32        SEND_FUNC_ARG                                            $25
         33        DO_FCALL                                      0          
         34        SEND_VAR_NO_REF_EX                                       $24
         35        DO_FCALL                                      0          
   13    36      > FE_RESET_R                                       $28     !5, ->47
         37    > > FE_FETCH_R                                               $28, !6, ->47
   14    38    >   INIT_FCALL                                               'array_merge'
   15    39        SEND_VAR                                                 !4
   16    40        INIT_FCALL                                               'array_filter'
         41        SEND_VAR                                                 !6
         42        DO_ICALL                                         $29     
         43        SEND_VAR                                                 $29
   14    44        DO_ICALL                                         $30     
         45        ASSIGN                                                   !4, $30
   13    46      > JMP                                                      ->37
         47    >   FE_FREE                                                  $28
   19    48        INIT_FCALL                                               'var_dump'
         49        SEND_VAR                                                 !4
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.75 ms | 1017 KiB | 16 Q