3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractDomainObject { protected $id = null; /** * Id */ public function setId($id) { if (!is_null($this->id)) { throw new Exception('This object already has an id set and it can not be changed. Use the data mapper to create a new domain object.'); } $this->id = $id; return $this; } public function getId() { return $this->id; } } class Article extends AbstractDomainObject { protected $title = null; protected $published = null; protected $content = null; /** * Title */ public function setTitle($title) { $this->title = $title; return $this; } public function getTitle() { return $this->title; } /** * Published at */ public function setPublished($published) { $this->published = $published; return $this; } public function getPublished() { return $this->published; } /** * Content */ public function setContent($content) { $this->content = $content; return $this; } public function getContent() { return $this->content; } } class Test { public function __construct(AbstractDomainObject $t) { } } $test = new Test(new Article()); ?>
Output for git.master, git.master_jit, rfc.property-hooks

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:
44.85 ms | 401 KiB | 8 Q