3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyCollection extends ArrayObject { public function updateIndexes() { $this->exchangeArray(array_values($this->getArrayCopy())); } } $collection = new MyCollection([ 'first', 'second', 'third', ]); var_dump($collection); $collection->offsetUnset(1); var_dump($collection); $collection->updateIndexes(); var_dump($collection);
Output for git.master, git.master_jit, rfc.property-hooks
object(MyCollection)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { [0]=> string(5) "first" [1]=> string(6) "second" [2]=> string(5) "third" } } object(MyCollection)#1 (1) { ["storage":"ArrayObject":private]=> array(2) { [0]=> string(5) "first" [2]=> string(5) "third" } } object(MyCollection)#1 (1) { ["storage":"ArrayObject":private]=> array(2) { [0]=> string(5) "first" [1]=> string(5) "third" } }

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:
30.76 ms | 406 KiB | 5 Q