3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EmptyIterator extends Iterator implements Countable { /** No operation. * @return void */ function rewind() { // nothing to do } /** @return \c false */ function valid() { return false; } /** This function must not be called. It throws an exception upon access. * @throw Exception * @return void */ function current() { throw new Exception('Accessing the value of an EmptyIterator'); } /** This function must not be called. It throws an exception upon access. * @throw Exception * @return void */ function key() { throw new Exception('Accessing the key of an EmptyIterator'); } /** No operation. * @return void */ function next() { // nothing to do } /** * @return int */ function count() { return 0; } } $ei = new EmptyIterator; echo count($ei);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Cannot declare class EmptyIterator, because the name is already in use in /in/VDOpJ on line 2
Process exited with code 255.

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:
56.63 ms | 401 KiB | 8 Q