3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cities = ['New York', 'Boston', 'Los Angeles', 'Cincinnati', 'Chicago', 'Houston', 'Philadelphia', 'Dallas', 'Seattle']; var_export( array_reduce( $cities, function($result, $city) { $result[$city[0]][] = $city; return $result; } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J7FbG
function name:  (null)
number of ops:  10
compiled vars:  !0 = $cities
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'var_export'
    6     2        INIT_FCALL                                               'array_reduce'
    7     3        SEND_VAR                                                 !0
    8     4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   11     5        SEND_VAL                                                 ~2
    6     6        DO_ICALL                                         $3      
   11     7        SEND_VAR                                                 $3
    5     8        DO_ICALL                                                 
   13     9      > 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/J7FbG
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $result, !1 = $city
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        FETCH_DIM_R                                      ~2      !1, 0
          3        FETCH_DIM_W                                      $3      !0, ~2
          4        ASSIGN_DIM                                               $3
          5        OP_DATA                                                  !1
   10     6      > RETURN                                                   !0
   11     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.76 ms | 1000 KiB | 15 Q