3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Passing as reference $variable = "broken"; $callback = function() use( &$variable) { $variable = "working"; }; $callback(); // Not passing by reference $variable2 = "broken"; $callback2 = function() use( $variable2) { $variable2 = "working"; }; $callback2(); echo "var1 = $variable , var2 = $variable2";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jZESL
function name:  (null)
number of ops:  18
compiled vars:  !0 = $variable, !1 = $callback, !2 = $variable2, !3 = $callback2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'broken'
    4     1        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          2        BIND_LEXICAL                                                 ~5, !0
          3        ASSIGN                                                       !1, ~5
    7     4        INIT_DYNAMIC_CALL                                            !1
          5        DO_FCALL                                          0          
   10     6        ASSIGN                                                       !2, 'broken'
   11     7        DECLARE_LAMBDA_FUNCTION                              ~9      [1]
          8        BIND_LEXICAL                                                 ~9, !2
          9        ASSIGN                                                       !3, ~9
   14    10        INIT_DYNAMIC_CALL                                            !3
         11        DO_FCALL                                          0          
   16    12        ROPE_INIT                                         4  ~13     'var1+%3D+'
         13        ROPE_ADD                                          1  ~13     ~13, !0
         14        ROPE_ADD                                          2  ~13     ~13, '++%2C+var2+%3D+'
         15        ROPE_END                                          3  ~12     ~13, !2
         16        ECHO                                                         ~12
         17      > 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/jZESL
function name:  {closure:/in/jZESL:4}
number of ops:  3
compiled vars:  !0 = $variable
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                                  !0
    5     1        ASSIGN                                                       !0, 'working'
    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/jZESL
function name:  {closure:/in/jZESL:11}
number of ops:  3
compiled vars:  !0 = $variable2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   BIND_STATIC                                                  !0
   12     1        ASSIGN                                                       !0, 'working'
   13     2      > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.9 ms | 2563 KiB | 13 Q