3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test1 { public static function testStaticMethod() { static $num = 0; $num++; echo __METHOD__ . " " . $num . PHP_EOL; } } class Test2 extends Test1 {} class Test3 extends Test1 {} Test1::testStaticMethod(); Test2::testStaticMethod(); Test3::testStaticMethod(); Test1::testStaticMethod(); Test2::testStaticMethod(); Test3::testStaticMethod();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nFrPh
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'Test1', 'testStaticMethod'
          1        DO_FCALL                                      0          
   17     2        INIT_STATIC_METHOD_CALL                                  'Test2', 'testStaticMethod'
          3        DO_FCALL                                      0          
   18     4        INIT_STATIC_METHOD_CALL                                  'Test3', 'testStaticMethod'
          5        DO_FCALL                                      0          
   19     6        INIT_STATIC_METHOD_CALL                                  'Test1', 'testStaticMethod'
          7        DO_FCALL                                      0          
   20     8        INIT_STATIC_METHOD_CALL                                  'Test2', 'testStaticMethod'
          9        DO_FCALL                                      0          
   21    10        INIT_STATIC_METHOD_CALL                                  'Test3', 'testStaticMethod'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Test1:
Function teststaticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nFrPh
function name:  testStaticMethod
number of ops:  6
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    7     1        PRE_INC                                                  !0
    8     2        CONCAT                                           ~2      'Test1%3A%3AtestStaticMethod+', !0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
    9     5      > RETURN                                                   null

End of function teststaticmethod

End of class Test1.

Class Test2:
Function teststaticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nFrPh
function name:  testStaticMethod
number of ops:  6
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    7     1        PRE_INC                                                  !0
    8     2        CONCAT                                           ~2      'Test1%3A%3AtestStaticMethod+', !0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
    9     5      > RETURN                                                   null

End of function teststaticmethod

End of class Test2.

Class Test3:
Function teststaticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nFrPh
function name:  testStaticMethod
number of ops:  6
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    7     1        PRE_INC                                                  !0
    8     2        CONCAT                                           ~2      'Test1%3A%3AtestStaticMethod+', !0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
    9     5      > RETURN                                                   null

End of function teststaticmethod

End of class Test3.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.62 ms | 1399 KiB | 13 Q