3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AClass { public static $prop = "Hi"; } function assignRef (&$ref) { $ref = &AClass::$prop; echo "inside assignRef: $ref\n"; } $ref = "Hello"; echo "outside: $ref\n"; assignRef($ref); echo "outside: $ref\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jbW43
function name:  (null)
number of ops:  13
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 'Hello'
   12     1        ROPE_INIT                                     3  ~3      'outside%3A+'
          2        ROPE_ADD                                      1  ~3      ~3, !0
          3        ROPE_END                                      2  ~2      ~3, '%0A'
          4        ECHO                                                     ~2
   13     5        INIT_FCALL                                               'assignref'
          6        SEND_REF                                                 !0
          7        DO_FCALL                                      0          
   14     8        ROPE_INIT                                     3  ~7      'outside%3A+'
          9        ROPE_ADD                                      1  ~7      ~7, !0
         10        ROPE_END                                      2  ~6      ~7, '%0A'
         11        ECHO                                                     ~6
         12      > RETURN                                                   1

Function assignref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jbW43
function name:  assignRef
number of ops:  8
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        FETCH_STATIC_PROP_W          unknown             $1      'prop'
          2        ASSIGN_REF                                               !0, $1
    9     3        ROPE_INIT                                     3  ~4      'inside+assignRef%3A+'
          4        ROPE_ADD                                      1  ~4      ~4, !0
          5        ROPE_END                                      2  ~3      ~4, '%0A'
          6        ECHO                                                     ~3
   10     7      > RETURN                                                   null

End of function assignref

Class AClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.73 ms | 1397 KiB | 14 Q