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"; assignRef($ref); echo "outside: $ref\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sIo1b
function name:  (null)
number of ops:  9
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 'Hello'
   12     1        INIT_FCALL                                               'assignref'
          2        SEND_REF                                                 !0
          3        DO_FCALL                                      0          
   13     4        ROPE_INIT                                     3  ~4      'outside%3A+'
          5        ROPE_ADD                                      1  ~4      ~4, !0
          6        ROPE_END                                      2  ~3      ~4, '%0A'
          7        ECHO                                                     ~3
          8      > RETURN                                                   1

Function assignref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sIo1b
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:
154.76 ms | 1389 KiB | 14 Q