3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static $foo; public static function getStatic() { return static::$foo; } public static function getSelf() { return self::$foo; } public static function setStatic($val) { static::$foo = $val; } public static function setSelf($val) { self::$foo = $val; } } class B extends A { } class C extends B { } A::setStatic('bar'); B::setStatic('baz'); C::setStatic('bam'); var_dump(C::getStatic()); var_dump(C::getSelf());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZYYc
function name:  (null)
number of ops:  20
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'setStatic'
          1        SEND_VAL                                                 'bar'
          2        DO_FCALL                                      0          
   39     3        INIT_STATIC_METHOD_CALL                                  'B', 'setStatic'
          4        SEND_VAL                                                 'baz'
          5        DO_FCALL                                      0          
   40     6        INIT_STATIC_METHOD_CALL                                  'C', 'setStatic'
          7        SEND_VAL                                                 'bam'
          8        DO_FCALL                                      0          
   42     9        INIT_FCALL                                               'var_dump'
         10        INIT_STATIC_METHOD_CALL                                  'C', 'getStatic'
         11        DO_FCALL                                      0  $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                                 
   43    14        INIT_FCALL                                               'var_dump'
         15        INIT_STATIC_METHOD_CALL                                  'C', 'getSelf'
         16        DO_FCALL                                      0  $5      
         17        SEND_VAR                                                 $5
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

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

End of function getstatic

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

End of function getself

Function setstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZYYc
function name:  setStatic
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        ASSIGN_STATIC_PROP                                       'foo'
          2        OP_DATA                                                  !0
   20     3      > RETURN                                                   null

End of function setstatic

Function setself:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZYYc
function name:  setSelf
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ASSIGN_STATIC_PROP                                       'foo'
          2        OP_DATA                                                  !0
   25     3      > RETURN                                                   null

End of function setself

End of class A.

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

End of function getstatic

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

End of function getself

Function setstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZYYc
function name:  setStatic
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        ASSIGN_STATIC_PROP                                       'foo'
          2        OP_DATA                                                  !0
   20     3      > RETURN                                                   null

End of function setstatic

Function setself:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZYYc
function name:  setSelf
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ASSIGN_STATIC_PROP                                       'foo'
          2        OP_DATA                                                  !0
   25     3      > RETURN                                                   null

End of function setself

End of class B.

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

End of function getstatic

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

End of function getself

Function setstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZYYc
function name:  setStatic
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        ASSIGN_STATIC_PROP                                       'foo'
          2        OP_DATA                                                  !0
   20     3      > RETURN                                                   null

End of function setstatic

Function setself:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZYYc
function name:  setSelf
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ASSIGN_STATIC_PROP                                       'foo'
          2        OP_DATA                                                  !0
   25     3      > RETURN                                                   null

End of function setself

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.28 ms | 1404 KiB | 15 Q