3v4l.org

run code in 300+ PHP versions simultaneously
<?php // parent class class Vehicle { // private property name private $name; // public function start public function start() { echo $this->name. " - Engine start...<br/>"; } // public function stop public function stop() { echo $this->name. " - Engine stop...<br/>"; } } // child class class Car extends Vehicle { public function drive() { // accessing name variable of Car class echo "I am " . $this->name . "<br/>"; echo "Lets go on a drive..."; } } $car = new Car(); $car->name = "Mercedes benz"; var_dump($car);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OieYm
function name:  (null)
number of ops:  9
compiled vars:  !0 = $car
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  31     0  E >   NEW                                              $1      :13
         1        DO_FCALL                                      0          
         2        ASSIGN                                                   !0, $1
  32     3        ASSIGN_OBJ                                               !0, 'name'
         4        OP_DATA                                                  'Mercedes+benz'
  33     5        INIT_FCALL                                               'var_dump'
         6        SEND_VAR                                                 !0
         7        DO_ICALL                                                 
         8      > RETURN                                                   1

Class Vehicle:
Function start:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OieYm
function name:  start
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   FETCH_OBJ_R                                      ~0      'name'
         1        CONCAT                                           ~1      ~0, '+-+Engine+start...%3Cbr%2F%3E'
         2        ECHO                                                     ~1
  11     3      > RETURN                                                   null

End of function start

Function stop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OieYm
function name:  stop
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   FETCH_OBJ_R                                      ~0      'name'
         1        CONCAT                                           ~1      ~0, '+-+Engine+stop...%3Cbr%2F%3E'
         2        ECHO                                                     ~1
  16     3      > RETURN                                                   null

End of function stop

End of class Vehicle.

Class Car:
Function drive:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OieYm
function name:  drive
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  24     0  E >   FETCH_OBJ_R                                      ~0      'name'
         1        CONCAT                                           ~1      'I+am+', ~0
         2        CONCAT                                           ~2      ~1, '%3Cbr%2F%3E'
         3        ECHO                                                     ~2
  25     4        ECHO                                                     'Lets+go+on+a+drive...'
  26     5      > RETURN                                                   null

End of function drive

Function start:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OieYm
function name:  start
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   FETCH_OBJ_R                                      ~0      'name'
         1        CONCAT                                           ~1      ~0, '+-+Engine+start...%3Cbr%2F%3E'
         2        ECHO                                                     ~1
  11     3      > RETURN                                                   null

End of function start

Function stop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OieYm
function name:  stop
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   FETCH_OBJ_R                                      ~0      'name'
         1        CONCAT                                           ~1      ~0, '+-+Engine+stop...%3Cbr%2F%3E'
         2        ECHO                                                     ~1
  16     3      > RETURN                                                   null

End of function stop

End of class Car.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
12.23 ms | 416 KiB | 7 Q