3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=array( Array ( 0 => 3, 1 => 1 ), Array ( 0 => 3, 1 => 2 ), Array ( 0 => 3, 1 => 128 ), Array ( 0 => 39, 1 => 4 )); $col0 = array_unique(array_column($arr, 0)); Foreach($col0 as $val){ // $res[] = [$val, Var_dump(array_sum(array_intersect_key($arr, array_intersect($col0, [$val])))); } Var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 27
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 27
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/OAJfJ
function name:  (null)
number of ops:  32
compiled vars:  !0 = $arr, !1 = $col0, !2 = $val, !3 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   25     1        INIT_FCALL                                               'array_unique'
          2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !1, $6
   27     9      > FE_RESET_R                                       $8      !1, ->27
         10    > > FE_FETCH_R                                               $8, !2, ->27
   29    11    >   INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'array_sum'
         13        INIT_FCALL                                               'array_intersect_key'
         14        SEND_VAR                                                 !0
         15        INIT_FCALL                                               'array_intersect'
         16        SEND_VAR                                                 !1
         17        INIT_ARRAY                                       ~9      !2
         18        SEND_VAL                                                 ~9
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
         21        DO_ICALL                                         $11     
         22        SEND_VAR                                                 $11
         23        DO_ICALL                                         $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                                 
   27    26      > JMP                                                      ->10
         27    >   FE_FREE                                                  $8
   31    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.17 ms | 1396 KiB | 25 Q