3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.94 ms | 996 KiB | 14 Q