3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $staticProperty = 'foobar'; public $property = 'barfoo'; private $privateProperty = 'foofoo'; } $reflectionClass = new ReflectionClass('Foo'); $reflectionClass->getProperty('privateProperty')->setAccessible(true); var_dump($reflectionClass->getProperty('staticProperty')->getValue()); var_dump($reflectionClass->getProperty('property')->getValue(new Foo)); var_dump($reflectionClass->getProperty('privateProperty')->getValue());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QY7t1
function name:  (null)
number of ops:  38
compiled vars:  !0 = $reflectionClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   11     4        INIT_METHOD_CALL                                         !0, 'getProperty'
          5        SEND_VAL_EX                                              'privateProperty'
          6        DO_FCALL                                      0  $4      
          7        INIT_METHOD_CALL                                         $4, 'setAccessible'
          8        SEND_VAL_EX                                              <true>
          9        DO_FCALL                                      0          
   13    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !0, 'getProperty'
         12        SEND_VAL_EX                                              'staticProperty'
         13        DO_FCALL                                      0  $6      
         14        INIT_METHOD_CALL                                         $6, 'getValue'
         15        DO_FCALL                                      0  $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
   14    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !0, 'getProperty'
         20        SEND_VAL_EX                                              'property'
         21        DO_FCALL                                      0  $9      
         22        INIT_METHOD_CALL                                         $9, 'getValue'
         23        NEW                                              $10     'Foo'
         24        DO_FCALL                                      0          
         25        SEND_VAR_NO_REF_EX                                       $10
         26        DO_FCALL                                      0  $12     
         27        SEND_VAR                                                 $12
         28        DO_ICALL                                                 
   15    29        INIT_FCALL                                               'var_dump'
         30        INIT_METHOD_CALL                                         !0, 'getProperty'
         31        SEND_VAL_EX                                              'privateProperty'
         32        DO_FCALL                                      0  $14     
         33        INIT_METHOD_CALL                                         $14, 'getValue'
         34        DO_FCALL                                      0  $15     
         35        SEND_VAR                                                 $15
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.79 ms | 1396 KiB | 15 Q