3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait FooBarTrait { /** * @var string */ private $value; /** * {@inheritdoc} */ public function setValue(string $value): void { $this->value = $value; } /** * {@inheritdoc} */ public function getValue(): string { return $this->value; } } interface Bar { /** * @param string $value */ public function setValue(string $value): void; /** * @return string */ public function getValue(): string; } class Foo implements Bar { use FooBarTrait; } $foobar = new Foo(); $foobar->setValue('bob'); echo $foobar->getValue();
Output for git.master_jit, git.master, rfc.property-hooks
bob

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