3v4l.org

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

Class ClassName: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.51 ms | 1395 KiB | 15 Q