3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); abstract class Object {} interface iObjectID { public function getId(); public function setId(int $id = NULL); } trait tObjectID { /** * @TF: {column => id, type => int} * integer $id */ protected $id; public function getId() { return $this->id; } public function setId(int $id = NULL) { $this->id = $id; } } trait tObjectName { /** * @TF: {column => name, type => string} * string $name */ protected $name; public function getName(): string { return $this->name; } public function setName(string $name = NULL) { $this->name = $name; } } trait tObjectCoolurl { /** * @TF: {column => coolurl, type => string} * string $coolurl */ protected $coolurl; public function getCoolurl(): string { return $this->coolurl; } public function setCoolurl(string $coolurl = NULL) { $this->coolurl = $coolurl; } } class Gallery extends Object implements iObjectID { use tObjectID; use tObjectName; use tObjectCoolurl; } //Instantiate the reflection object $reflector = new ReflectionClass('Gallery'); // Now get all the properties from class A in to $properties array $properties = $reflector->getProperties(); var_dump($properties);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Cannot use 'Object' as class name as it is reserved in /in/AWRtc on line 4
Process exited with code 255.

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.24 ms | 401 KiB | 8 Q