3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function printItem($string) { echo 'Foo: ' . $string ; } public function printPHP() { echo 'PHP is great.' . PHP_EOL; } } class bar extends foo { public function printItem($string) { echo 'Bar: ' . $string . PHP_EOL; } } $foo = new foo(); $bar = new bar(); $foo->printItem('baz'); // Output: 'Foo: baz' $foo->printPHP(); // Output: 'PHP is great' $bar->printItem('baz'); // Output: 'Bar: baz' $bar->printPHP(); // Output: 'PHP is great' ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AX8ua
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   26     3        NEW                                              $5      'bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   27     6        INIT_METHOD_CALL                                         !0, 'printItem'
          7        SEND_VAL_EX                                              'baz'
          8        DO_FCALL                                      0          
   28     9        INIT_METHOD_CALL                                         !0, 'printPHP'
         10        DO_FCALL                                      0          
   29    11        INIT_METHOD_CALL                                         !1, 'printItem'
         12        SEND_VAL_EX                                              'baz'
         13        DO_FCALL                                      0          
   30    14        INIT_METHOD_CALL                                         !1, 'printPHP'
         15        DO_FCALL                                      0          
   33    16      > RETURN                                                   1

Class foo:
Function printitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AX8ua
function name:  printItem
number of ops:  4
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        CONCAT                                           ~1      'Foo%3A+', !0
          2        ECHO                                                     ~1
    9     3      > RETURN                                                   null

End of function printitem

Function printphp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AX8ua
function name:  printPHP
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'PHP+is+great.%0A'
   14     1      > RETURN                                                   null

End of function printphp

End of class foo.

Class bar:
Function printitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AX8ua
function name:  printItem
number of ops:  5
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        CONCAT                                           ~1      'Bar%3A+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   22     4      > RETURN                                                   null

End of function printitem

Function printphp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AX8ua
function name:  printPHP
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'PHP+is+great.%0A'
   14     1      > RETURN                                                   null

End of function printphp

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.21 ms | 1399 KiB | 13 Q