3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { public static $prop = 'BASE'; } class Mock extends Base { } $excepted = 'REFLECTED'; $property = new ReflectionProperty('Base', 'prop'); $property->setValue($excepted); echo "Should be $excepted and is {Base::$prop}\n"; echo "Should be $excepted and is {Mock::$prop}\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i8Z1J
function name:  (null)
number of ops:  22
compiled vars:  !0 = $excepted, !1 = $property, !2 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'REFLECTED'
   15     1        NEW                                              $4      'ReflectionProperty'
          2        SEND_VAL_EX                                              'Base'
          3        SEND_VAL_EX                                              'prop'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
   16     6        INIT_METHOD_CALL                                         !1, 'setValue'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   18     9        ROPE_INIT                                     5  ~9      'Should+be+'
         10        ROPE_ADD                                      1  ~9      ~9, !0
         11        ROPE_ADD                                      2  ~9      ~9, '+and+is+%7BBase%3A%3A'
         12        ROPE_ADD                                      3  ~9      ~9, !2
         13        ROPE_END                                      4  ~8      ~9, '%7D%0A'
         14        ECHO                                                     ~8
   19    15        ROPE_INIT                                     5  ~13     'Should+be+'
         16        ROPE_ADD                                      1  ~13     ~13, !0
         17        ROPE_ADD                                      2  ~13     ~13, '+and+is+%7BMock%3A%3A'
         18        ROPE_ADD                                      3  ~13     ~13, !2
         19        ROPE_END                                      4  ~12     ~13, '%7D%0A'
         20        ECHO                                                     ~12
         21      > RETURN                                                   1

Class Base: [no user functions]
Class Mock: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.6 ms | 1393 KiB | 13 Q