3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cmp($b, $c){ global $a; var_dump($a); $a->exchangeArray(array()); } $a = new ArrayObject(); $a[1] = 1; $a[2] = 2; $a[3] = 3; $a->uasort('cmp');
Output for git.master, git.master_jit, rfc.property-hooks
object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { [1]=> int(1) [2]=> int(2) [3]=> int(3) } } Fatal error: Uncaught Error: Modification of ArrayObject during sorting is prohibited in /in/RtLnW:6 Stack trace: #0 /in/RtLnW(6): ArrayObject->exchangeArray(Array) #1 [internal function]: cmp(1, 2) #2 [internal function]: uasort(Array, 'cmp') #3 /in/RtLnW(14): ArrayObject->uasort('cmp') #4 {main} thrown in /in/RtLnW on line 6
Process exited with code 255.

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