3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car { const CAR_TYPE = 'CAR'; protected $carName = 'Terry'; public function __construct() { printf("My name is %s, I'm a %s\n\n", $this->carName, self::CAR_TYPE); } } class Ferrari extends Car { const CAR_TYPE = 'FERRARI'; protected $carName = 'Fred'; } $car = new Car(); $ferrari = new Ferrari();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W4v4s
function name:  (null)
number of ops:  7
compiled vars:  !0 = $car, !1 = $ferrari
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'Car'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   21     3        NEW                                              $5      'Ferrari'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
          6      > RETURN                                                   1

Class Car:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W4v4s
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'printf'
          1        SEND_VAL                                                 'My+name+is+%25s%2C+I%27m+a+%25s%0A%0A'
          2        FETCH_OBJ_R                                      ~0      'carName'
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 'CAR'
          5        DO_ICALL                                                 
   11     6      > RETURN                                                   null

End of function __construct

End of class Car.

Class Ferrari:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W4v4s
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'printf'
          1        SEND_VAL                                                 'My+name+is+%25s%2C+I%27m+a+%25s%0A%0A'
          2        FETCH_OBJ_R                                      ~0      'carName'
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 'CAR'
          5        DO_ICALL                                                 
   11     6      > RETURN                                                   null

End of function __construct

End of class Ferrari.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.92 ms | 1396 KiB | 15 Q