3v4l.org

run code in 300+ PHP versions simultaneously
<?php function simple ( & $var) { $var = 2; } $lambda = function( & $var) { $var = 2; }; $var1 = 1; simple($var1); var_dump($var1); $var2 = 1; $lambda($var2); var_dump($var2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P7G9b
function name:  (null)
number of ops:  17
compiled vars:  !0 = $lambda, !1 = $var1, !2 = $var2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FP7G9b%3A8%240'
          1        ASSIGN                                                   !0, ~3
   13     2        ASSIGN                                                   !1, 1
   14     3        INIT_FCALL                                               'simple'
          4        SEND_REF                                                 !1
          5        DO_FCALL                                      0          
   15     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   17     9        ASSIGN                                                   !2, 1
   18    10        INIT_DYNAMIC_CALL                                        !0
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0          
   19    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function simple:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P7G9b
function name:  simple
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !0, 2
    6     2      > RETURN                                                   null

End of function simple

Function %00%7Bclosure%7D%2Fin%2FP7G9b%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P7G9b
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        ASSIGN                                                   !0, 2
   11     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FP7G9b%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.9 ms | 1390 KiB | 16 Q