3v4l.org

run code in 300+ PHP versions simultaneously
<?php function by_ref (&$ref) { $ref = 42; } function by_handle ($handle) { $handle = 42; } $thing1 = new class {}; $thing2 = new class {}; by_ref($thing1); by_handle($thing2); var_dump($thing1, $thing2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DLCN2
function name:  (null)
number of ops:  19
compiled vars:  !0 = $thing1, !1 = $thing2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_ANON_CLASS                               <const ast>   
          1        NEW                                              $3      $2
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   12     4        DECLARE_ANON_CLASS                               <unknown> 
          5        NEW                                              $7      $6
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   14     8        INIT_FCALL                                               'by_ref'
          9        SEND_REF                                                 !0
         10        DO_FCALL                                      0          
   15    11        INIT_FCALL                                               'by_handle'
         12        SEND_VAR                                                 !1
         13        DO_FCALL                                      0          
   17    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function by_ref

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

End of function by_handle

Class class@anonymous: [no user functions]
Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.42 ms | 1403 KiB | 17 Q