3v4l.org

run code in 500+ PHP versions simultaneously
<?php $full = [ 'Cars' => [ 'Volvo' => 0, 'Mercedes' => 0, 'BMW' => 0, 'Audi' => 0 ], 'Motorcycle' => [ 'Ducati' => 0, 'Honda' => 0, 'Suzuki' => 0, 'KTM' => 0 ] ]; $semi = [ 'Volvo' => 1, 'Audi' => 1 ]; array_walk_recursive( $full, fn(&$v, $k) => $v += $semi[$k] ?? 0 ); var_export($full);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iUcWh
function name:  (null)
number of ops:  12
compiled vars:  !0 = $full, !1 = $semi
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   18     1        ASSIGN                                                       !1, <array>
   23     2        INIT_FCALL                                                   'array_walk_recursive'
   24     3        SEND_REF                                                     !0
   25     4        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          5        BIND_LEXICAL                                                 ~4, !1
   26     6        SEND_VAL                                                     ~4
   23     7        DO_ICALL                                                     
   27     8        INIT_FCALL                                                   'var_export'
          9        SEND_VAR                                                     !0
         10        DO_ICALL                                                     
         11      > 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/iUcWh
function name:  {closure:/in/iUcWh:25}
number of ops:  9
compiled vars:  !0 = $v, !1 = $k, !2 = $semi
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
          3        FETCH_DIM_IS                                         ~3      !2, !1
          4        COALESCE                                             ~4      ~3
          5        QM_ASSIGN                                            ~4      0
          6        ASSIGN_OP                                         1  ~5      !0, ~4
          7      > RETURN                                                       ~5
   26     8*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.44 ms | 1920 KiB | 15 Q