3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruitpacks = [ ['apples', 3], ['pears', 1], ['apples', 6], ['grapes', 22], ]; abstract class ⁇ { public static function ➕=(&$maybeDefined, int $value) { $maybeDefined = ($maybeDefined ?? 0) + $value; } } $totals_by_name = []; foreach ($fruitpacks as [$name, $amount]) { ⁇::➕=($totals_by_name[$name], $amount); } var_dump($totals_by_name);
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/MVT85
function name:  (null)
number of ops:  20
compiled vars:  !0 = $fruitpacks, !1 = $totals_by_name, !2 = $name, !3 = $amount
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, <array>
   17     2      > FE_RESET_R                                       $6      !0, ->15
          3    > > FE_FETCH_R                                               $6, $7, ->15
          4    >   FETCH_LIST_R                                     $8      $7, 0
          5        ASSIGN                                                   !2, $8
          6        FETCH_LIST_R                                     $10     $7, 1
          7        ASSIGN                                                   !3, $10
          8        FREE                                                     $7
   18     9        INIT_STATIC_METHOD_CALL                                  '%E2%81%87', '%E2%9E%95%EF%BC%9D'
         10        FETCH_DIM_W                                      $12     !1, !2
         11        SEND_REF                                                 $12
         12        SEND_VAR                                                 !3
         13        DO_FCALL                                      0          
   17    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $6
   21    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   22    19      > RETURN                                                   1

Class ⁇:
Function %E2%9E%95%EF%BC%9D:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MVT85
function name:  ➕=
number of ops:  7
compiled vars:  !0 = $maybeDefined, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        COALESCE                                         ~2      !0
          3        QM_ASSIGN                                        ~2      0
          4        ADD                                              ~3      ~2, !1
          5        ASSIGN                                                   !0, ~3
   13     6      > RETURN                                                   null

End of function %E2%9E%95%EF%BC%9D

End of class ⁇.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.64 ms | 1396 KiB | 15 Q