3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dashAccess = "1-10:rw,14:rw|10-10:ro,14:ro"; $outArray = []; foreach (explode('|', $dashAccess) as $bigPiece) { list($medKey, $medPiece) = explode('-', $bigPiece); $outArray[$medKey] = []; foreach (explode(',', $medPiece) as $smallPiece) { list($crumbleKey, $crumblePiece) = explode(':', $smallPiece); $outArray[$medKey][$crumbleKey] = $crumblePiece; } } var_dump($outArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 40
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 40
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 38
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 38
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/mOdb8
function name:  (null)
number of ops:  45
compiled vars:  !0 = $dashAccess, !1 = $outArray, !2 = $bigPiece, !3 = $medKey, !4 = $medPiece, !5 = $smallPiece, !6 = $crumbleKey, !7 = $crumblePiece
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1-10%3Arw%2C14%3Arw%7C10-10%3Aro%2C14%3Aro'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%7C'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $10     
          6      > FE_RESET_R                                       $11     $10, ->40
          7    > > FE_FETCH_R                                               $11, !2, ->40
    7     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '-'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $12     
         12        FETCH_LIST_R                                     $13     $12, 0
         13        ASSIGN                                                   !3, $13
         14        FETCH_LIST_R                                     $15     $12, 1
         15        ASSIGN                                                   !4, $15
         16        FREE                                                     $12
    8    17        ASSIGN_DIM                                               !1, !3
         18        OP_DATA                                                  <array>
    9    19        INIT_FCALL                                               'explode'
         20        SEND_VAL                                                 '%2C'
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                         $18     
         23      > FE_RESET_R                                       $19     $18, ->38
         24    > > FE_FETCH_R                                               $19, !5, ->38
   10    25    >   INIT_FCALL                                               'explode'
         26        SEND_VAL                                                 '%3A'
         27        SEND_VAR                                                 !5
         28        DO_ICALL                                         $20     
         29        FETCH_LIST_R                                     $21     $20, 0
         30        ASSIGN                                                   !6, $21
         31        FETCH_LIST_R                                     $23     $20, 1
         32        ASSIGN                                                   !7, $23
         33        FREE                                                     $20
   11    34        FETCH_DIM_W                                      $25     !1, !3
         35        ASSIGN_DIM                                               $25, !6
         36        OP_DATA                                                  !7
    9    37      > JMP                                                      ->24
         38    >   FE_FREE                                                  $19
    6    39      > JMP                                                      ->7
         40    >   FE_FREE                                                  $11
   15    41        INIT_FCALL                                               'var_dump'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.96 ms | 1400 KiB | 17 Q