3v4l.org

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

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
125.78 ms | 478 KiB | 8 Q