3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.6 ms | 1395 KiB | 15 Q