3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Person { protected $name; public function __construct( $name ) { $this->name = $name; } abstract public function speak(); } class Adult extends Person { public function speak() { echo "Hello, my name is " . $this->name; } } class Baby extends Person { public function speak() { echo "Goo goo ga ga"; } } $adult = new Adult( 'John' ); $baby = new Baby( 'Emma' ); $adult->speak(); $baby->speak();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9ksX
function name:  (null)
number of ops:  13
compiled vars:  !0 = $adult, !1 = $baby
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $2      'Adult'
          1        SEND_VAL_EX                                              'John'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   30     4        NEW                                              $5      'Baby'
          5        SEND_VAL_EX                                              'Emma'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   32     8        INIT_METHOD_CALL                                         !0, 'speak'
          9        DO_FCALL                                      0          
   33    10        INIT_METHOD_CALL                                         !1, 'speak'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Person:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9ksX
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'name'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

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

End of function speak

End of class Person.

Class Adult:
Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9ksX
function name:  speak
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        CONCAT                                           ~1      'Hello%2C+my+name+is+', ~0
          2        ECHO                                                     ~1
   18     3      > RETURN                                                   null

End of function speak

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9ksX
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'name'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

End of class Adult.

Class Baby:
Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9ksX
function name:  speak
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ECHO                                                     'Goo+goo+ga+ga'
   26     1      > RETURN                                                   null

End of function speak

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9ksX
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'name'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

End of class Baby.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.32 ms | 1399 KiB | 13 Q