3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Engine { protected $engine = 'AbstractEngine'; public function engine() { return $this->engine; } } class Car extends Engine { } $car = new Car(); echo $car->engine(); $engine = new Engine(); echo $engine->engine();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2EZNj
function name:  (null)
number of ops:  13
compiled vars:  !0 = $car, !1 = $engine
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Car'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        INIT_METHOD_CALL                                         !0, 'engine'
          4        DO_FCALL                                      0  $5      
          5        ECHO                                                     $5
   20     6        NEW                                              $6      'Engine'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   21     9        INIT_METHOD_CALL                                         !1, 'engine'
         10        DO_FCALL                                      0  $9      
         11        ECHO                                                     $9
         12      > RETURN                                                   1

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

End of function engine

End of class Engine.

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

End of function engine

End of class Car.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.35 ms | 1394 KiB | 13 Q