3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.99 ms | 998 KiB | 14 Q