3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { public static $foo = 'Base'; public function getSelf() { return self::$foo; } public function getStatic() { return static::$foo; } } class Child extends Base { public static $foo = 'Child'; } $base = new Base(); var_dump($base->getSelf(), $base->getStatic()); $child = new Child(); var_dump($child->getSelf(), $child->getStatic());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vVkii
function name:  (null)
number of ops:  23
compiled vars:  !0 = $base, !1 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'Base'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   15     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getSelf'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        INIT_METHOD_CALL                                         !0, 'getStatic'
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   17    11        NEW                                              $8      'Child'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $8
   18    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !1, 'getSelf'
         16        DO_FCALL                                      0  $11     
         17        SEND_VAR                                                 $11
         18        INIT_METHOD_CALL                                         !1, 'getStatic'
         19        DO_FCALL                                      0  $12     
         20        SEND_VAR                                                 $12
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class Base:
Function getself:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vVkii
function name:  getSelf
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'foo'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getself

Function getstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vVkii
function name:  getStatic
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'foo'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getstatic

End of class Base.

Class Child:
Function getself:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vVkii
function name:  getSelf
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'foo'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getself

Function getstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vVkii
function name:  getStatic
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'foo'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getstatic

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.86 ms | 1015 KiB | 14 Q