3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bar = 123; $one = function() use($bar){ echo $bar . "\n"; }; $two = function() use(&$bar){ echo $bar; }; $bar = 456; $one(); $two();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bu9dM
function name:  (null)
number of ops:  13
compiled vars:  !0 = $bar, !1 = $one, !2 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 123
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fbu9dM%3A5%240'
          2        BIND_LEXICAL                                             ~4, !0
          3        ASSIGN                                                   !1, ~4
    9     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fbu9dM%3A9%241'
          5        BIND_LEXICAL                                             ~6, !0
          6        ASSIGN                                                   !2, ~6
   13     7        ASSIGN                                                   !0, 456
   15     8        INIT_DYNAMIC_CALL                                        !1
          9        DO_FCALL                                      0          
   16    10        INIT_DYNAMIC_CALL                                        !2
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fbu9dM%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bu9dM
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        CONCAT                                           ~1      !0, '%0A'
          2        ECHO                                                     ~1
    7     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fbu9dM%3A5%240

Function %00%7Bclosure%7D%2Fin%2Fbu9dM%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bu9dM
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        ECHO                                                     !0
   11     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fbu9dM%3A9%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.72 ms | 1398 KiB | 13 Q