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

Function assignref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rQcas
function name:  assignRef
number of ops:  9
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                                                   !0
   11     8*     > RETURN                                                   null

End of function assignref

Class AClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.81 ms | 1397 KiB | 14 Q