3v4l.org

run code in 500+ PHP versions simultaneously
<?php class a { function foo() { echo __METHOD__ . PHP_EOL; } } class b extends a {} class c extends b { function bar() { $this::foo(); $this->foo(); a::foo(); b::foo(); c::foo(); d::foo(); static::foo(); self::foo(); parent::foo(); } } class d extends c {} (new c)->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j04vj
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   NEW                                                  $0      'c'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'bar'
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

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

End of function foo

End of class a.

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

End of function foo

End of class b.

Class c:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j04vj
function name:  bar
number of ops:  21
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   FETCH_THIS                                           ~0      
          1        FETCH_CLASS                                       0  $1      ~0
          2        INIT_STATIC_METHOD_CALL                                      $1, 'foo'
          3        DO_FCALL                                          0          
   13     4        INIT_METHOD_CALL                                             'foo'
          5        DO_FCALL                                          0          
   14     6        INIT_STATIC_METHOD_CALL                                      'a', 'foo'
          7        DO_FCALL                                          0          
   15     8        INIT_STATIC_METHOD_CALL                                      'b', 'foo'
          9        DO_FCALL                                          0          
   16    10        INIT_STATIC_METHOD_CALL                                      'c', 'foo'
         11        DO_FCALL                                          0          
   17    12        INIT_STATIC_METHOD_CALL                                      'd', 'foo'
         13        DO_FCALL                                          0          
   18    14        INIT_STATIC_METHOD_CALL                                      'foo'
         15        DO_FCALL                                          0          
   19    16        INIT_STATIC_METHOD_CALL                                      'foo'
         17        DO_FCALL                                          0          
   20    18        INIT_STATIC_METHOD_CALL                                      'foo'
         19        DO_FCALL                                          0          
   21    20      > RETURN                                                       null

End of function bar

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

End of function foo

End of class c.

Class d:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j04vj
function name:  bar
number of ops:  21
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   FETCH_THIS                                           ~0      
          1        FETCH_CLASS                                       0  $1      ~0
          2        INIT_STATIC_METHOD_CALL                                      $1, 'foo'
          3        DO_FCALL                                          0          
   13     4        INIT_METHOD_CALL                                             'foo'
          5        DO_FCALL                                          0          
   14     6        INIT_STATIC_METHOD_CALL                                      'a', 'foo'
          7        DO_FCALL                                          0          
   15     8        INIT_STATIC_METHOD_CALL                                      'b', 'foo'
          9        DO_FCALL                                          0          
   16    10        INIT_STATIC_METHOD_CALL                                      'c', 'foo'
         11        DO_FCALL                                          0          
   17    12        INIT_STATIC_METHOD_CALL                                      'd', 'foo'
         13        DO_FCALL                                          0          
   18    14        INIT_STATIC_METHOD_CALL                                      'foo'
         15        DO_FCALL                                          0          
   19    16        INIT_STATIC_METHOD_CALL                                      'foo'
         17        DO_FCALL                                          0          
   20    18        INIT_STATIC_METHOD_CALL                                      'foo'
         19        DO_FCALL                                          0          
   21    20      > RETURN                                                       null

End of function bar

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

End of function foo

End of class d.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.04 ms | 1490 KiB | 13 Q