3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { protected static $property = 'foo'; public function method() { echo static::$property . "\n"; } } class Child extends Base { public function __construct() { static::$property = 'bar'; } } echo "base1\n"; $base1 = new Base(); $base1->method(); echo "child\n"; $child = new Child(); $child->method(); echo "base2\n"; $base2 = new Base(); $base2->method();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4RVua
function name:  (null)
number of ops:  19
compiled vars:  !0 = $base1, !1 = $child, !2 = $base2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'base1%0A'
   13     1        NEW                                              $3      'Base'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   14     4        INIT_METHOD_CALL                                         !0, 'method'
          5        DO_FCALL                                      0          
   16     6        ECHO                                                     'child%0A'
   17     7        NEW                                              $7      'Child'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   18    10        INIT_METHOD_CALL                                         !1, 'method'
         11        DO_FCALL                                      0          
   20    12        ECHO                                                     'base2%0A'
   21    13        NEW                                              $11     'Base'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !2, $11
   22    16        INIT_METHOD_CALL                                         !2, 'method'
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Class Base:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4RVua
function name:  method
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'property'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function method

End of class Base.

Class Child:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4RVua
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_STATIC_PROP                                       'property'
          1        OP_DATA                                                  'bar'
          2      > RETURN                                                   null

End of function __construct

Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4RVua
function name:  method
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'property'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function method

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.26 ms | 1399 KiB | 13 Q