3v4l.org

run code in 300+ PHP versions simultaneously
<?php $categories = array("MainCategory" => array(0,0,0), 'SubCategory' => array(1,7,7,7,7,1), 'Keyword' => array()); $mainArray = $categories['MainCategory']; $subArray = $categories['SubCategory']; $keyArray = $categories['Keyword']; if (count($mainArray) === 0) { $mainArray = array(""); } if (count($subArray) === 0) { $subArray = array(""); } if (count($keyArray) === 0) { $keyArray = array('lastname', 'email', 'phone'); } foreach ($subArray as $subcat) { foreach ($mainArray as $cat) { foreach ($keyArray as $keys) { echo $cat; echo $subcat; echo implode(',',$keys); } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 37
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 37
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 35
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 35
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 33
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 33
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 35
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 19
Branch analysis from position: 15
Branch analysis from position: 11
filename:       /in/qJJTN
function name:  (null)
number of ops:  39
compiled vars:  !0 = $categories, !1 = $mainArray, !2 = $subArray, !3 = $keyArray, !4 = $subcat, !5 = $cat, !6 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        FETCH_DIM_R                                      ~8      !0, 'MainCategory'
          2        ASSIGN                                                   !1, ~8
    4     3        FETCH_DIM_R                                      ~10     !0, 'SubCategory'
          4        ASSIGN                                                   !2, ~10
    5     5        FETCH_DIM_R                                      ~12     !0, 'Keyword'
          6        ASSIGN                                                   !3, ~12
    7     7        COUNT                                            ~14     !1
          8        IS_IDENTICAL                                             ~14, 0
          9      > JMPZ                                                     ~15, ->11
    8    10    >   ASSIGN                                                   !1, <array>
   10    11    >   COUNT                                            ~17     !2
         12        IS_IDENTICAL                                             ~17, 0
         13      > JMPZ                                                     ~18, ->15
   11    14    >   ASSIGN                                                   !2, <array>
   13    15    >   COUNT                                            ~20     !3
         16        IS_IDENTICAL                                             ~20, 0
         17      > JMPZ                                                     ~21, ->19
   14    18    >   ASSIGN                                                   !3, <array>
   16    19    > > FE_RESET_R                                       $23     !2, ->37
         20    > > FE_FETCH_R                                               $23, !4, ->37
   17    21    > > FE_RESET_R                                       $24     !1, ->35
         22    > > FE_FETCH_R                                               $24, !5, ->35
   18    23    > > FE_RESET_R                                       $25     !3, ->33
         24    > > FE_FETCH_R                                               $25, !6, ->33
   19    25    >   ECHO                                                     !5
   20    26        ECHO                                                     !4
   21    27        INIT_FCALL                                               'implode'
         28        SEND_VAL                                                 '%2C'
         29        SEND_VAR                                                 !6
         30        DO_ICALL                                         $26     
         31        ECHO                                                     $26
   18    32      > JMP                                                      ->24
         33    >   FE_FREE                                                  $25
   17    34      > JMP                                                      ->22
         35    >   FE_FREE                                                  $24
   16    36      > JMP                                                      ->20
         37    >   FE_FREE                                                  $23
   25    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.1 ms | 1400 KiB | 15 Q