3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "-- Two empty iterators attached with infos that are different but same array key --\n"; $mit = new MultipleIterator(MultipleIterator::MIT_KEYS_ASSOC); $mit ->attachIterator(new EmptyIterator(), "2"); $mit ->attachIterator(new EmptyIterator(), 2); var_dump($mit->countIterators()); $mit->rewind(); var_dump($mit->current());

preferences:
57.34 ms | 407 KiB | 5 Q