3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Parent_ { public $prop; } class B extends Parent_ { } $r = new ReflectionProperty(B::class, 'prop'); $parent = new Parent_(); $r->setValue($parent, 42); var_dump($parent);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E0srl
function name:  (null)
number of ops:  16
compiled vars:  !0 = $r, !1 = $parent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'ReflectionProperty'
          1        SEND_VAL_EX                                              'B'
          2        SEND_VAL_EX                                              'prop'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   11     5        NEW                                              $5      'Parent_'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   12     8        INIT_METHOD_CALL                                         !0, 'setValue'
          9        SEND_VAR_EX                                              !1
         10        SEND_VAL_EX                                              42
         11        DO_FCALL                                      0          
   14    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class Parent_: [no user functions]
Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.52 ms | 1000 KiB | 14 Q