3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = [ array( 'id' => '183970', 'player1' => 'Weird', 'player2' => 'Bloodbuddy', 'player1_items' => '644:204,10:200000,', 'player2_items' => '38:200,', ), array ( 'id' => '183969', 'player1' => 'Frog', 'player2' => 'Eh', 'player1_items' => '656:1,11:3797,33:1111,42:200,40:100,31:1111,1263:1,522:1,', 'player2_items' => '405:1,', )]; foreach ($result as $item) { print "Player: {$item["player1"]}\n"; foreach (explode(',', $item['player1_items']) as $player1_item) { if(empty($player1_item)) continue; [$type, $qty] = explode(":", $player1_item); print "$type: $qty\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 35
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 35
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 33
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 33
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 33
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/Vuqpu
function name:  (null)
number of ops:  37
compiled vars:  !0 = $result, !1 = $item, !2 = $player1_item, !3 = $type, !4 = $qty
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $6      !0, ->35
          2    > > FE_FETCH_R                                               $6, !1, ->35
    7     3    >   ROPE_INIT                                     3  ~9      'Player%3A+'
          4        FETCH_DIM_R                                      ~7      !1, 'player1'
          5        ROPE_ADD                                      1  ~9      ~9, ~7
          6        ROPE_END                                      2  ~8      ~9, '%0A'
          7        ECHO                                                     ~8
    8     8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%2C'
         10        FETCH_DIM_R                                      ~11     !1, 'player1_items'
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                         $12     
         13      > FE_RESET_R                                       $13     $12, ->33
         14    > > FE_FETCH_R                                               $13, !2, ->33
   10    15    >   ISSET_ISEMPTY_CV                                         !2
         16      > JMPZ                                                     ~14, ->18
         17    > > JMP                                                      ->14
   11    18    >   INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '%3A'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $15     
         22        FETCH_LIST_R                                     $16     $15, 0
         23        ASSIGN                                                   !3, $16
         24        FETCH_LIST_R                                     $18     $15, 1
         25        ASSIGN                                                   !4, $18
         26        FREE                                                     $15
   12    27        ROPE_INIT                                     4  ~21     !3
         28        ROPE_ADD                                      1  ~21     ~21, '%3A+'
         29        ROPE_ADD                                      2  ~21     ~21, !4
         30        ROPE_END                                      3  ~20     ~21, '%0A'
         31        ECHO                                                     ~20
    8    32      > JMP                                                      ->14
         33    >   FE_FREE                                                  $13
    5    34      > JMP                                                      ->2
         35    >   FE_FREE                                                  $6
   14    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.89 ms | 1400 KiB | 15 Q