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 5.4.0 - 5.4.31
Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) in /in/ihaOK on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '{', expecting T_FUNCTION in /in/ihaOK on line 4
Process exited with code 255.

preferences:
199.55 ms | 1395 KiB | 68 Q