3v4l.org

run code in 300+ PHP versions simultaneously
<?php $biger_array = array( $a = array("DHL","ACS", "UPS"), $b = array("PayPal", "BrainTree", "UnionPay") ); $sizeof_biger_array = sizeof($biger_array); $array_with_size_of_smaller_arrays = array(); for ($x=0; $x<$sizeof_biger_array; $x++){ //$array_with_size_of_smaller_arrays[] =; $array_with_size_of_smaller_arrays[] = sizeof($biger_array[$x]); } function forLoopDynamic(array $array, array $number_of_vars_in_every_array) { //print 'Inside `aMemberFunc()`'; $sizeOfTheBigerArray = sizeof($array_with_size_of_smaller_arrays); for ($i=0; $i<$sizeOfTheBigerArray; $i++){ echo $number_of_vars_in_every_array[$i]; //for ($x=0; $x<($number_of_vars_in_every_array[$i]); $x++){ //echo $array[$x]; //} } } forLoopDynamic($a, $array_with_size_of_smaller_arrays); //echo $biger_array[0][0]; //echo $biger_array[1][0]; echo sizeof($array_with_size_of_smaller_arrays); //print_R($array_with_size_of_smaller_arrays);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
Branch analysis from position: 10
filename:       /in/lQYCh
function name:  (null)
number of ops:  24
compiled vars:  !0 = $biger_array, !1 = $a, !2 = $b, !3 = $sizeof_biger_array, !4 = $array_with_size_of_smaller_arrays, !5 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                           ~6      !1, <array>
          1        INIT_ARRAY                                       ~7      ~6
    6     2        ASSIGN                                           ~8      !2, <array>
          3        ADD_ARRAY_ELEMENT                                ~7      ~8
    3     4        ASSIGN                                                   !0, ~7
    9     5        COUNT                                            ~10     !0
          6        ASSIGN                                                   !3, ~10
   11     7        ASSIGN                                                   !4, <array>
   13     8        ASSIGN                                                   !5, 0
          9      > JMP                                                      ->15
   16    10    >   FETCH_DIM_R                                      ~15     !0, !5
         11        COUNT                                            ~16     ~15
         12        ASSIGN_DIM                                               !4
         13        OP_DATA                                                  ~16
   13    14        PRE_INC                                                  !5
         15    >   IS_SMALLER                                               !5, !3
         16      > JMPNZ                                                    ~18, ->10
   39    17    >   INIT_FCALL                                               'forloopdynamic'
         18        SEND_VAR                                                 !1
         19        SEND_VAR                                                 !4
         20        DO_FCALL                                      0          
   43    21        COUNT                                            ~20     !4
         22        ECHO                                                     ~20
   44    23      > RETURN                                                   1

Function forloopdynamic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/lQYCh
function name:  forLoopDynamic
number of ops:  12
compiled vars:  !0 = $array, !1 = $number_of_vars_in_every_array, !2 = $sizeOfTheBigerArray, !3 = $array_with_size_of_smaller_arrays, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        COUNT                                            ~5      !3
          3        ASSIGN                                                   !2, ~5
   25     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->9
   26     6    >   FETCH_DIM_R                                      ~8      !1, !4
          7        ECHO                                                     ~8
   25     8        PRE_INC                                                  !4
          9    >   IS_SMALLER                                               !4, !2
         10      > JMPNZ                                                    ~10, ->6
   36    11    > > RETURN                                                   null

End of function forloopdynamic

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.14 ms | 1407 KiB | 14 Q