3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeClass { var $someProperty; function __construct($prop) { $this->someProperty = $prop; } function getSomeProperty() { return $this->someProperty; } function __toString() { return "" . $this->someProperty; } } $arr = array(); $someObject = new SomeClass(3); $arr[] = $someObject; $arr[] = $someObject; $someOtherObject = new SomeClass(4); $arr[] = $someOtherObject; $arr[] = $someOtherObject; print_r($arr); $arrFiltered = array_unique($arr); print_r($arrFiltered);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => SomeClass Object ( [someProperty] => 3 ) [1] => SomeClass Object ( [someProperty] => 3 ) [2] => SomeClass Object ( [someProperty] => 4 ) [3] => SomeClass Object ( [someProperty] => 4 ) ) Array ( [0] => SomeClass Object ( [someProperty] => 3 ) [2] => SomeClass Object ( [someProperty] => 4 ) )

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