3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => ['page' => 'page1', 'name' => 'pagename1'], 'b' => ['page' => 'page2', 'name' => 'pagename2'], 'c' => ['page' => 'page3', 'name' => 'pagename3'], 'd' => ['page' => 'page4',], ]; var_export(array_reduce($array, fn($result, $row) => array_merge($result, [$row['name'] ?? 'missing']), []));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GbWGR
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'array_reduce'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          5        SEND_VAL                                                 ~2
          6        SEND_VAL                                                 <array>
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
         10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GbWGR
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $result, !1 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'array_merge'
          3        SEND_VAR                                                 !0
          4        FETCH_DIM_IS                                     ~2      !1, 'name'
          5        COALESCE                                         ~3      ~2
          6        QM_ASSIGN                                        ~3      'missing'
          7        INIT_ARRAY                                       ~4      ~3
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10      > RETURN                                                   $5
         11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.35 ms | 1012 KiB | 16 Q