3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.64 ms | 1394 KiB | 15 Q