3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Vehicle { protected $name = 'YourMom'; public function getName(): string { return $this->name; } } class Truck extends Vehicle { protected $weight = 100; public function getWeight(): int { return $this->weight; } } #main wannabie :p { $truck = new Truck; if ($truck instanceof Vehicle) { echo '#idiot'; } else { echo '#youwin'; } #}
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5s78p
function name:  (null)
number of ops:  9
compiled vars:  !0 = $truck
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Truck'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INSTANCEOF                                               !0, 'Vehicle'
          4      > JMPZ                                                     ~4, ->7
   24     5    >   ECHO                                                     '%23idiot'
          6      > JMP                                                      ->8
   27     7    >   ECHO                                                     '%23youwin'
   30     8    > > RETURN                                                   1

Class Vehicle:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5s78p
function name:  getName
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
    7     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getname

End of class Vehicle.

Class Truck:
Function getweight:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5s78p
function name:  getWeight
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'weight'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   15     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getweight

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5s78p
function name:  getName
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
    7     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getname

End of class Truck.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.4 ms | 1395 KiB | 13 Q