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();
Output for git.master, git.master_jit, rfc.property-hooks
My name is Terry, I'm a CAR My name is Fred, I'm a CAR

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.11 ms | 401 KiB | 8 Q