3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = [ 'a' => [], 'b' => ['total' => ['column' => '1']], 'c' => ['total' => ['column' => '2']], ]; function get_total($input) { foreach ($input as $v) { yeild (isset($v['total']) ? $v : null); } } var_dump(get_total($test));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UEMM1
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'get_total'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function get_total:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/UEMM1
function name:  get_total
number of ops:  14
compiled vars:  !0 = $input, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1      > FE_RESET_R                                       $2      !0, ->12
          2    > > FE_FETCH_R                                               $2, !1, ->12
   11     3    >   INIT_FCALL_BY_NAME                                       'yeild'
          4        ISSET_ISEMPTY_DIM_OBJ                         0          !1, 'total'
          5      > JMPZ                                                     ~3, ->8
          6    >   QM_ASSIGN                                        ~4      !1
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~4      null
          9    >   SEND_VAL_EX                                              ~4
         10        DO_FCALL                                      0          
   10    11      > JMP                                                      ->2
         12    >   FE_FREE                                                  $2
   13    13      > RETURN                                                   null

End of function get_total

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.76 ms | 1399 KiB | 16 Q