3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function printName() { echo 'Hello from class'. self::getName(); } public static function getName() { return 'Foo'; } } class Bar extends Foo { public static function getName() { return 'Bar'; } } $bar = new Bar(); $bar->printName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TThcX
function name:  (null)
number of ops:  6
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'printName'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Foo:
Function printname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TThcX
function name:  printName
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_STATIC_METHOD_CALL                                  'getName'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Hello+from+class', $0
          3        ECHO                                                     ~1
    6     4      > RETURN                                                   null

End of function printname

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TThcX
function name:  getName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'Foo'
    9     1*     > RETURN                                                   null

End of function getname

End of class Foo.

Class Bar:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TThcX
function name:  getName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   'Bar'
   15     1*     > RETURN                                                   null

End of function getname

Function printname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TThcX
function name:  printName
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_STATIC_METHOD_CALL                                  'getName'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Hello+from+class', $0
          3        ECHO                                                     ~1
    6     4      > RETURN                                                   null

End of function printname

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.26 ms | 1395 KiB | 13 Q