3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [ 'one' => 1, 'forty-two' => 42, 'zero' => 0, 'one hundred eleven' => 111, ]; $i = new \ArrayIterator($a); var_dump($i); $i->arsort(); var_dump($i);
based on JTu39
Output for 7.0.0 - 7.2.6
object(ArrayIterator)#1 (1) { ["storage":"ArrayIterator":private]=> array(4) { ["one"]=> int(1) ["forty-two"]=> int(42) ["zero"]=> int(0) ["one hundred eleven"]=> int(111) } } Fatal error: Uncaught Error: Call to undefined method ArrayIterator::arsort() in /in/kr0PR:14 Stack trace: #0 {main} thrown in /in/kr0PR on line 14
Process exited with code 255.
Output for hhvm-3.15.4
object(ArrayIterator)#1 (2) { ["storage":"ArrayIterator":private]=> array(4) { ["one"]=> int(1) ["forty-two"]=> int(42) ["zero"]=> int(0) ["one hundred eleven"]=> int(111) } ["flags":"ArrayIterator":private]=> int(0) } Fatal error: Uncaught Error: Call to undefined method ArrayIterator::arsort() in /in/kr0PR:14 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
object(ArrayIterator)#1 (1) { ["storage":"ArrayIterator":private]=> array(4) { ["one"]=> int(1) ["forty-two"]=> int(42) ["zero"]=> int(0) ["one hundred eleven"]=> int(111) } } Fatal error: Call to undefined method ArrayIterator::arsort() in /in/kr0PR on line 14
Process exited with code 255.