3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public static $myStaticProperty; public $myInstanceProperty; } $staticPropertyName = 'myStaticProperty'; $instancePropertyName = 'myInstanceProperty'; MyClass::${$staticPropertyName} = 'my static value'; $obj = new MyClass(); $obj->{$instancePropertyName} = 'my instance value'; var_dump(MyClass::${$staticPropertyName}); var_dump($obj->{$instancePropertyName});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K7U3Q
function name:  (null)
number of ops:  18
compiled vars:  !0 = $staticPropertyName, !1 = $instancePropertyName, !2 = $obj
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   7     0  E >   QM_ASSIGN                                                !0
   8     1        QM_ASSIGN                                                !1
  10     2        ASSIGN_MUL                                    0          !0, 'MyClass'
         3        OP_DATA                                                  'my+static+value'
  11     4        NEW                                              $6      :28
         5        DO_FCALL                                      0          
         6        QM_ASSIGN                                                !2
  12     7        ASSIGN_SUB                                    0          !2, !1
         8        OP_DATA                                                  'my+instance+value'
  14     9        INIT_FCALL                                               'var_dump'
        10        FETCH_STATIC_PROP_R          unknown             ~10     !0
        11        SEND_VAL                                                 ~10
        12        DO_ICALL                                                 
  15    13        INIT_FCALL                                               'var_dump'
        14        FETCH_OBJ_R                                      ~12     !2, !1
        15        SEND_VAL                                                 ~12
        16        DO_ICALL                                                 
        17      > RETURN                                                   1

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.4.0