3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! function reduce_table_size($value, $item) { return $value + $item['index_length'] + $item['data_length']; } $tables = array( 0 => array('index_length' => 1, 'data_length' => 2), 1 => array('index_length' => 3, 'data_length' => 4) ); $size = array_reduce($tables, 'reduce_table_size'); echo $size;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YFkJj
function name:  (null)
number of ops:  8
compiled vars:  !0 = $tables, !1 = $size
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'array_reduce'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'reduce_table_size'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   14     6        ECHO                                                     !1
          7      > RETURN                                                   1

Function reduce_table_size:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YFkJj
function name:  reduce_table_size
number of ops:  8
compiled vars:  !0 = $value, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        FETCH_DIM_R                                      ~2      !1, 'index_length'
          3        ADD                                              ~3      !0, ~2
          4        FETCH_DIM_R                                      ~4      !1, 'data_length'
          5        ADD                                              ~5      ~3, ~4
          6      > RETURN                                                   ~5
    6     7*     > RETURN                                                   null

End of function reduce_table_size

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.23 ms | 1395 KiB | 15 Q