3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass; $a->id = 2; $b = new stdClass; $b->id = 2; $case1 = array_unique([$a, $b], SORT_REGULAR); $storage = new SplObjectStorage(); $storage->attach($a); $storage->attach($b); $case2 = iterator_to_array($storage); var_dump($case1, $case2);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [0]=> object(stdClass)#1 (1) { ["id"]=> int(2) } } array(2) { [0]=> object(stdClass)#1 (1) { ["id"]=> int(2) } [1]=> object(stdClass)#2 (1) { ["id"]=> int(2) } }

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