3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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');
based on tnfhe
Output for 7.0.6 - 7.2.0
object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { [1]=> int(1) [2]=> int(2) [3]=> int(3) } } Warning: Modification of ArrayObject during sorting is prohibited in /in/RtLnW on line 6 object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { [1]=> int(1) [2]=> int(2) [3]=> int(3) } } Warning: Modification of ArrayObject during sorting is prohibited in /in/RtLnW on line 6
Output for 7.0.5
object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { [1]=> int(1) [2]=> int(2) [3]=> int(3) [3]=> int(3) } } Warning: Modification of ArrayObject during sorting is prohibited in /in/RtLnW on line 6 object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { [1]=> int(1) [2]=> int(2) [3]=> int(3) [3]=> int(3) } } Warning: Modification of ArrayObject during sorting is prohibited in /in/RtLnW on line 6
Output for 7.0.0 - 7.0.4
object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> *RECURSION* } object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } }
Output for 5.3.21 - 5.6.28
object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> *RECURSION* } object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } }
Process exited with code 139.