3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); $a = [ 0 => 2, 1 => 8, 2 => 10 ]; $b = [ 0 => 5, 1 => 2, 2 => 7 ]; $c = [ 0 => 7, 1 => 4, 2 => 2 ]; function arraysSum(array ...$arrays): array { return array_map(function(array $array): int { return array_sum($array); }, $arrays); } $ar = arraysSum($a,$b,$c); print_r($ar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sPeIv
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $ar
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        ASSIGN                                                       !1, <array>
   15     2        ASSIGN                                                       !2, <array>
   28     3        INIT_FCALL                                                   'arrayssum'
          4        SEND_VAR                                                     !0
          5        SEND_VAR                                                     !1
          6        SEND_VAR                                                     !2
          7        DO_FCALL                                          0  $7      
          8        ASSIGN                                                       !3, $7
   30     9        INIT_FCALL                                                   'print_r'
         10        SEND_VAR                                                     !3
         11        DO_ICALL                                                     
         12      > RETURN                                                       1

Function arrayssum:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sPeIv
function name:  arraysSum
number of ops:  10
compiled vars:  !0 = $arrays
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   RECV_VARIADIC                                        !0      
   23     1        INIT_FCALL                                                   'array_map'
          2        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
   25     3        SEND_VAL                                                     ~1
          4        SEND_VAR                                                     !0
   23     5        DO_ICALL                                             $2      
   25     6        VERIFY_RETURN_TYPE                                           $2
          7      > RETURN                                                       $2
   26     8*       VERIFY_RETURN_TYPE                                           
          9*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sPeIv
function name:  {closure:arraysSum():23}
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   RECV                                                 !0      
   24     1        INIT_FCALL                                                   'array_sum'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $1      
          4        VERIFY_RETURN_TYPE                                           $1
          5      > RETURN                                                       $1
   25     6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of Dynamic Function 0

End of function arrayssum

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.79 ms | 3309 KiB | 17 Q