3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $heap = new SplMaxHeap(); $heap->insert('111'); $heap->insert('666'); $heap->insert('777'); echo $heap->extract(); // 777 echo $heap->extract(); // 666 echo $heap->extract(); // 111 $heap = new SplMinHeap(); $heap->insert('111'); $heap->insert('666'); $heap->insert('777'); echo $heap->extract(); // 111 echo $heap->extract(); // 666 echo $heap->extract(); // 777
Output for 5.3.0 - 7.1.0
777666111111666777
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.2.17
Fatal error: Class 'SplMaxHeap' not found in /in/PjDqs on line 3
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/PjDqs on line 19
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splmaxheap in /in/PjDqs on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splmaxheap in /in/PjDqs on line 3