3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {}; $a = new A(); class B {}; $b = new B(); $array = array(); for($i=0; $i<28; $i++) $array[$i] = $a; $array[0] = $array[26] = $b; var_dump($array); $array = array_unique($array,SORT_REGULAR); var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
array(28) { [0]=> object(B)#2 (0) { } [1]=> object(A)#1 (0) { } [2]=> object(A)#1 (0) { } [3]=> object(A)#1 (0) { } [4]=> object(A)#1 (0) { } [5]=> object(A)#1 (0) { } [6]=> object(A)#1 (0) { } [7]=> object(A)#1 (0) { } [8]=> object(A)#1 (0) { } [9]=> object(A)#1 (0) { } [10]=> object(A)#1 (0) { } [11]=> object(A)#1 (0) { } [12]=> object(A)#1 (0) { } [13]=> object(A)#1 (0) { } [14]=> object(A)#1 (0) { } [15]=> object(A)#1 (0) { } [16]=> object(A)#1 (0) { } [17]=> object(A)#1 (0) { } [18]=> object(A)#1 (0) { } [19]=> object(A)#1 (0) { } [20]=> object(A)#1 (0) { } [21]=> object(A)#1 (0) { } [22]=> object(A)#1 (0) { } [23]=> object(A)#1 (0) { } [24]=> object(A)#1 (0) { } [25]=> object(A)#1 (0) { } [26]=> object(B)#2 (0) { } [27]=> object(A)#1 (0) { } } array(5) { [0]=> object(B)#2 (0) { } [1]=> object(A)#1 (0) { } [2]=> object(A)#1 (0) { } [13]=> object(A)#1 (0) { } [26]=> object(B)#2 (0) { } }

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:
95.53 ms | 403 KiB | 8 Q