3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { var $dateTime; var $string; public function __construct() { $this->dateTime = new \DateTime(); $this->string = 'foo'; } public function __clone() { $this->dateTime = clone $this->dateTime; } } $obj1 = new Foo(); $obj2 = clone $obj1; $obj1->string = 'foo bar'; $obj1->dateTime->add(new \DateInterval('P1Y')); var_dump($obj1->dateTime->format('Y-m-d')); var_dump($obj1->string); var_dump($obj2->dateTime->format('Y-m-d')); var_dump($obj2->string);
Output for git.master, git.master_jit, rfc.property-hooks
string(10) "2018-07-03" string(7) "foo bar" string(10) "2017-07-03" string(3) "foo"

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