3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AbstractFoo { protected static $state; public static function setState($state) { static::$state = $state; } public static function getState() { return static::$state; } } class Foo extends AbstractFoo {} class Bar extends AbstractFoo {} $Foo = new Foo; $bar = new Bar; AbstractFoo::setState('abstract'); var_dump($bar::getState()); $foo::setState('foo'); var_dump($bar::getState());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBSKk
function name:  (null)
number of ops:  26
compiled vars:  !0 = $Foo, !1 = $bar, !2 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   24     3        NEW                                              $6      'Bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   25     6        INIT_STATIC_METHOD_CALL                                  'AbstractFoo', 'setState'
          7        SEND_VAL                                                 'abstract'
          8        DO_FCALL                                      0          
   26     9        INIT_FCALL                                               'var_dump'
         10        FETCH_CLASS                                   0  $10     !1
         11        INIT_STATIC_METHOD_CALL                                  $10, 'getState'
         12        DO_FCALL                                      0  $11     
         13        SEND_VAR                                                 $11
         14        DO_ICALL                                                 
   27    15        FETCH_CLASS                                   0  $13     !2
         16        INIT_STATIC_METHOD_CALL                                  $13, 'setState'
         17        SEND_VAL_EX                                              'foo'
         18        DO_FCALL                                      0          
   28    19        INIT_FCALL                                               'var_dump'
         20        FETCH_CLASS                                   0  $15     !1
         21        INIT_STATIC_METHOD_CALL                                  $15, 'getState'
         22        DO_FCALL                                      0  $16     
         23        SEND_VAR                                                 $16
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Class AbstractFoo:
Function setstate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBSKk
function name:  setState
number of ops:  4
compiled vars:  !0 = $state
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_STATIC_PROP                                       'state'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function setstate

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

End of function getstate

End of class AbstractFoo.

Class Foo:
Function setstate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBSKk
function name:  setState
number of ops:  4
compiled vars:  !0 = $state
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_STATIC_PROP                                       'state'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function setstate

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

End of function getstate

End of class Foo.

Class Bar:
Function setstate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBSKk
function name:  setState
number of ops:  4
compiled vars:  !0 = $state
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_STATIC_PROP                                       'state'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function setstate

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

End of function getstate

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.71 ms | 1400 KiB | 15 Q