3v4l.org

run code in 300+ PHP versions simultaneously
<?php function matrix_push(array $matrix, array $push, $x, $y) { list($i, $j) = array($x, $y); foreach ($push as $row) { foreach ($row as $int) { $matrix[$i][$j++] += $int; } $i++; $j = $y; } return $matrix; } $matrix = array( array(0, 0, 0, 0, 0, 0), array(0, 0, 0, 0, 0, 0), array(0, 0, 0, 0, 0, 0), array(0, 0, 0, 0, 0, 0), array(0, 0, 0, 0, 0, 0), array(0, 0, 0, 0, 0, 0) ); var_dump(matrix_push($matrix, array(array(1,1), array(1,1)), 2, 2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3mNib
function name:  (null)
number of ops:  11
compiled vars:  !0 = $matrix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   27     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'matrix_push'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <array>
          5        SEND_VAL                                                 2
          6        SEND_VAL                                                 2
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function matrix_push:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 24
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 24
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 20
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/3mNib
function name:  matrix_push
number of ops:  27
compiled vars:  !0 = $matrix, !1 = $push, !2 = $x, !3 = $y, !4 = $i, !5 = $j, !6 = $row, !7 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4        INIT_ARRAY                                       ~8      !2
          5        ADD_ARRAY_ELEMENT                                ~8      !3
          6        FETCH_LIST_R                                     $9      ~8, 0
          7        ASSIGN                                                   !4, $9
          8        FETCH_LIST_R                                     $11     ~8, 1
          9        ASSIGN                                                   !5, $11
         10        FREE                                                     ~8
    6    11      > FE_RESET_R                                       $13     !1, ->24
         12    > > FE_FETCH_R                                               $13, !6, ->24
    7    13    > > FE_RESET_R                                       $14     !6, ->20
         14    > > FE_FETCH_R                                               $14, !7, ->20
    8    15    >   POST_INC                                         ~16     !5
         16        FETCH_DIM_RW                                     $15     !0, !4
         17        ASSIGN_DIM_OP                +=               1          $15, ~16
         18        OP_DATA                                                  !7
    7    19      > JMP                                                      ->14
         20    >   FE_FREE                                                  $14
   10    21        PRE_INC                                                  !4
   11    22        ASSIGN                                                   !5, !3
    6    23      > JMP                                                      ->12
         24    >   FE_FREE                                                  $13
   14    25      > RETURN                                                   !0
   15    26*     > RETURN                                                   null

End of function matrix_push

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.22 ms | 1407 KiB | 16 Q