3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $prop; } $foo = new Foo(); $str = 'abc'; // $str is a string $foo->prop = &$str; var_dump($foo->prop); // "abc" $arr = array(); $foo->prop = $arr; var_dump($foo->prop); // array() var_dump($str); // array() - surprise! $str is now an array
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A2gKE
function name:  (null)
number of ops:  21
compiled vars:  !0 = $foo, !1 = $str, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    9     3        ASSIGN                                                   !1, 'abc'
   10     4        ASSIGN_OBJ_REF                                           !0, 'prop'
          5        OP_DATA                                                  !1
   11     6        INIT_FCALL                                               'var_dump'
          7        FETCH_OBJ_R                                      ~8      !0, 'prop'
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                                 
   13    10        ASSIGN                                                   !2, <array>
   14    11        ASSIGN_OBJ                                               !0, 'prop'
         12        OP_DATA                                                  !2
   15    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~12     !0, 'prop'
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                                 
   16    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.57 ms | 988 KiB | 14 Q