3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { /** * @JMS\Type("double") * * @var float */ protected $price; /** * @JMS\Type("string") * * @var string */ protected $priceTag; /** * @JMS\Type("DateTime<'h:i'>") * * @var \DateTime */ protected $time; /** * @param float $price * * @return $this */ public function setPrice($price) { $this->price = $price; return $this; } /** * @return float */ public function getPrice() { return $this->price; } /** * @param string $priceTag * * @return $this */ public function setPriceTag($priceTag) { $this->priceTag = $priceTag; return $this; } /** * @return string */ public function getPriceTag() { return $this->priceTag; } /** * @param \DateTime $time * * @return $this */ public function setTime($time) { $this->time = $time; return $this; } /** * @return \DateTime */ public function getTime() { return $this->time; } } $foo = new MyClass(); $foo->setPriceTag('test1'); $bar = new MyClass(); $bar->setPriceTag('test1'); $bam = new MyClass(); $bam->setPriceTag('test2'); $test = array($foo, $bar, $bam); print_r(array_unique($test, SORT_REGULAR));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => MyClass Object ( [price:protected] => [priceTag:protected] => test1 [time:protected] => ) [2] => MyClass Object ( [price:protected] => [priceTag:protected] => test2 [time:protected] => ) )

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:
36.96 ms | 402 KiB | 8 Q