3v4l.org

run code in 500+ PHP versions simultaneously
<?php $bar = [ function() use (&$k) { echo "first!"; }, function() use (&$k) { echo "second!"; }, ]; sort($bar); $bar[0]();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kH84K
function name:  (null)
number of ops:  14
compiled vars:  !0 = $bar, !1 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          1        BIND_LEXICAL                                                 ~2, !1
    6     2        INIT_ARRAY                                           ~3      ~2
    7     3        DECLARE_LAMBDA_FUNCTION                              ~4      [1]
          4        BIND_LEXICAL                                                 ~4, !1
    9     5        ADD_ARRAY_ELEMENT                                    ~3      ~4
    3     6        ASSIGN                                                       !0, ~3
   12     7        INIT_FCALL                                                   'sort'
          8        SEND_REF                                                     !0
          9        DO_ICALL                                                     
   14    10        FETCH_DIM_R                                          ~7      !0, 0
         11        INIT_DYNAMIC_CALL                                            ~7
         12        DO_FCALL                                          0          
         13      > 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/kH84K
function name:  {closure:/in/kH84K:4}
number of ops:  3
compiled vars:  !0 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                                  !0
    5     1        ECHO                                                         'first%21'
    6     2      > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kH84K
function name:  {closure:/in/kH84K:7}
number of ops:  3
compiled vars:  !0 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                                  !0
    8     1        ECHO                                                         'second%21'
    9     2      > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
129.14 ms | 478 KiB | 8 Q