3v4l.org

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

Class foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
210.07 ms | 1395 KiB | 15 Q