3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function test() {echo __METHOD__ . "\n";} public static function testStatic() {echo __METHOD__ . "\n";} } class MyClass2 extends MyClass { public function test() { echo __METHOD__ . "\n"; $c = array('parent','test'); $c(); } public static function testStatic() { echo __METHOD__ . "\n"; $c = array('parent','testStatic'); $c(); $c = array('static','testLate'); $c(); } } class MyClass3 extends MyClass2 { public static function testLate() {echo __METHOD__ . "\n";} } echo "call object method:\n"; $o = new MyClass3(); $o->test(); $o->testStatic(); echo "call static method:\n"; MyClass3::testStatic();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoZSg
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   ECHO                                                     'call+object+method%3A%0A'
   30     1        NEW                                              $1      'MyClass3'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   31     4        INIT_METHOD_CALL                                         !0, 'test'
          5        DO_FCALL                                      0          
   32     6        INIT_METHOD_CALL                                         !0, 'testStatic'
          7        DO_FCALL                                      0          
   34     8        ECHO                                                     'call+static+method%3A%0A'
   35     9        INIT_STATIC_METHOD_CALL                                  'MyClass3', 'testStatic'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class MyClass:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoZSg
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'MyClass%3A%3Atest%0A'
          1      > RETURN                                                   null

End of function test

Function teststatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoZSg
function name:  testStatic
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'MyClass%3A%3AtestStatic%0A'
          1      > RETURN                                                   null

End of function teststatic

End of class MyClass.

Class MyClass2:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoZSg
function name:  test
number of ops:  5
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'MyClass2%3A%3Atest%0A'
   11     1        ASSIGN                                                   !0, <array>
   12     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   13     4      > RETURN                                                   null

End of function test

Function teststatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoZSg
function name:  testStatic
number of ops:  8
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     'MyClass2%3A%3AtestStatic%0A'
   17     1        ASSIGN                                                   !0, <array>
   18     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   20     4        ASSIGN                                                   !0, <array>
   21     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0          
   22     7      > RETURN                                                   null

End of function teststatic

End of class MyClass2.

Class MyClass3:
Function testlate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoZSg
function name:  testLate
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ECHO                                                     'MyClass3%3A%3AtestLate%0A'
          1      > RETURN                                                   null

End of function testlate

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoZSg
function name:  test
number of ops:  5
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'MyClass2%3A%3Atest%0A'
   11     1        ASSIGN                                                   !0, <array>
   12     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   13     4      > RETURN                                                   null

End of function test

Function teststatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoZSg
function name:  testStatic
number of ops:  8
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     'MyClass2%3A%3AtestStatic%0A'
   17     1        ASSIGN                                                   !0, <array>
   18     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   20     4        ASSIGN                                                   !0, <array>
   21     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0          
   22     7      > RETURN                                                   null

End of function teststatic

End of class MyClass3.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.52 ms | 1399 KiB | 13 Q