3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = 0; $result2 = 10; $one = function() { var_dump($result); }; $two = function() use ($result) { var_dump($result); }; $three = function() use (&$result) { var_dump($result); }; $four = function($result2) use (&$result) { var_dump($result2); }; $result++; $four();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chbWM
function name:  (null)
number of ops:  17
compiled vars:  !0 = $result, !1 = $result2, !2 = $one, !3 = $two, !4 = $three, !5 = $four
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    3     1        ASSIGN                                                   !1, 10
    5     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FchbWM%3A5%240'
          3        ASSIGN                                                   !2, ~8
    7     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FchbWM%3A7%241'
          5        BIND_LEXICAL                                             ~10, !0
          6        ASSIGN                                                   !3, ~10
   10     7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FchbWM%3A10%242'
          8        BIND_LEXICAL                                             ~12, !0
          9        ASSIGN                                                   !4, ~12
   13    10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FchbWM%3A13%243'
         11        BIND_LEXICAL                                             ~14, !0
         12        ASSIGN                                                   !5, ~14
   16    13        PRE_INC                                                  !0
   19    14        INIT_DYNAMIC_CALL                                        !5
         15        DO_FCALL                                      0          
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FchbWM%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chbWM
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAR                                                 !0
          2        DO_ICALL                                                 
          3      > RETURN                                                   null

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

Function %00%7Bclosure%7D%2Fin%2FchbWM%3A7%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chbWM
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FchbWM%3A7%241

Function %00%7Bclosure%7D%2Fin%2FchbWM%3A10%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chbWM
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_STATIC                                              !0
   11     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FchbWM%3A10%242

Function %00%7Bclosure%7D%2Fin%2FchbWM%3A13%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chbWM
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $result2, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   14     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
          5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FchbWM%3A13%243

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.07 ms | 1400 KiB | 15 Q