In PHP, how do I reduce traits in vanilla PHP?

In vanilla PHP, reducing traits can involve leveraging object-oriented principles like inheritance and interfaces to achieve code reusability without relying on traits.

PHP, inheritance, composition, object-oriented programming, code reuse
This article explains how to reduce the use of traits in vanilla PHP by focusing on inheritance and the composition of classes.
<?php abstract class Vehicle { abstract public function start(); } class Car extends Vehicle { public function start() { return "Car started"; } } class Bike extends Vehicle { public function start() { return "Bike started"; } } $car = new Car(); echo $car->start(); // Outputs: Car started $bike = new Bike(); echo $bike->start(); // Outputs: Bike started ?>

PHP inheritance composition object-oriented programming code reuse