3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mainStringBrk = array('page-18', 'page-20'); $finalArray = array(); foreach($mainStringBrk as $bString){ $mainStringBrkBrk = explode('-', $bString); $finalArray[$mainStringBrkBrk[0]][] = $mainStringBrkBrk[1]; } print_r($finalArray); $finalArray = array(); foreach($mainStringBrk as $bString){ $mainStringBrkBrk = explode('-', $bString); $finalArray[] = array($mainStringBrkBrk[0] => $mainStringBrkBrk[1]); } print_r($finalArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 33
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 33
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 15
filename:       /in/96lR7
function name:  (null)
number of ops:  38
compiled vars:  !0 = $mainStringBrk, !1 = $finalArray, !2 = $bString, !3 = $mainStringBrkBrk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $6      !0, ->15
          3    > > FE_FETCH_R                                               $6, !2, ->15
    6     4    >   INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '-'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
    7     9        FETCH_DIM_R                                      ~9      !3, 0
         10        FETCH_DIM_R                                      ~12     !3, 1
         11        FETCH_DIM_W                                      $10     !1, ~9
         12        ASSIGN_DIM                                               $10
         13        OP_DATA                                                  ~12
    5    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $6
    9    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   11    19        ASSIGN                                                   !1, <array>
   12    20      > FE_RESET_R                                       $15     !0, ->33
         21    > > FE_FETCH_R                                               $15, !2, ->33
   13    22    >   INIT_FCALL                                               'explode'
         23        SEND_VAL                                                 '-'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $16     
         26        ASSIGN                                                   !3, $16
   14    27        FETCH_DIM_R                                      ~19     !3, 0
         28        FETCH_DIM_R                                      ~20     !3, 1
         29        INIT_ARRAY                                       ~21     ~20, ~19
         30        ASSIGN_DIM                                               !1
         31        OP_DATA                                                  ~21
   12    32      > JMP                                                      ->21
         33    >   FE_FREE                                                  $15
   16    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.29 ms | 1016 KiB | 15 Q