3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class person { abstract protected function write_info(); public $LastName; public $FirstName; public $BirthDate; public function get_Age($today=NULL){ } } final class employee extends person{ public $EmployeeNumber; public $DateHired; public function write_info(){ echo "Writing ". $this->LastName . "'s info to emloyee dbase table"; } } final class student extends person{ public $StudentNumber; public $CourseName; public function write_info(){ echo "Writing ". $this->LastName . "'s info to student dbase table"; } } $personA = new employee; $personB = new student; $personA->FirstName="Joe"; $personA->LastName="body"; $personB->FirstName="Ben"; $personB->LastName="Dover"; $personA->write_info(); ?> OUTPUT:Writing Sbody's info to emloyee dbase table
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3djC
function name:  (null)
number of ops:  18
compiled vars:  !0 = $personA, !1 = $personB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $2      'employee'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   37     3        NEW                                              $5      'student'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   39     6        ASSIGN_OBJ                                               !0, 'FirstName'
          7        OP_DATA                                                  'Joe'
   40     8        ASSIGN_OBJ                                               !0, 'LastName'
          9        OP_DATA                                                  'body'
   42    10        ASSIGN_OBJ                                               !1, 'FirstName'
         11        OP_DATA                                                  'Ben'
   43    12        ASSIGN_OBJ                                               !1, 'LastName'
         13        OP_DATA                                                  'Dover'
   45    14        INIT_METHOD_CALL                                         !0, 'write_info'
         15        DO_FCALL                                      0          
   47    16        ECHO                                                     '%0AOUTPUT%3AWriting+Sbody%27s+info+to+emloyee+dbase+table'
   48    17      > RETURN                                                   1

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

End of function write_info

Function get_age:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3djC
function name:  get_Age
number of ops:  2
compiled vars:  !0 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV_INIT                                        !0      null
   13     1      > RETURN                                                   null

End of function get_age

End of class person.

Class employee:
Function write_info:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3djC
function name:  write_info
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'LastName'
          1        CONCAT                                           ~1      'Writing+', ~0
          2        CONCAT                                           ~2      ~1, '%27s+info+to+emloyee+dbase+table'
          3        ECHO                                                     ~2
   23     4      > RETURN                                                   null

End of function write_info

Function get_age:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3djC
function name:  get_Age
number of ops:  2
compiled vars:  !0 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV_INIT                                        !0      null
   13     1      > RETURN                                                   null

End of function get_age

End of class employee.

Class student:
Function write_info:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3djC
function name:  write_info
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   FETCH_OBJ_R                                      ~0      'LastName'
          1        CONCAT                                           ~1      'Writing+', ~0
          2        CONCAT                                           ~2      ~1, '%27s+info+to+student+dbase+table'
          3        ECHO                                                     ~2
   33     4      > RETURN                                                   null

End of function write_info

Function get_age:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3djC
function name:  get_Age
number of ops:  2
compiled vars:  !0 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV_INIT                                        !0      null
   13     1      > RETURN                                                   null

End of function get_age

End of class student.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.22 ms | 1399 KiB | 13 Q