3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable { /** * Returns whether the requested key exists * * @param mixed $key * @return bool */ public function __isset($key) { } /** * Sets the value at the specified key to value * * @param mixed $key * @param mixed $value * @return void */ public function __set($key, $value) { } /** * Unsets the value at the specified key * * @param mixed $key * @return void */ public function __unset($key) { } /** * Returns the value at the specified key by reference * * @param mixed $key * @return mixed */ public function &__get($key) { } /** * Appends the value * * @param mixed $value * @return void */ public function append($value) { } /** * Sort the entries by value * * @return void */ public function asort() { } /** * Get the number of public properties in the ArrayObject * * @return int */ public function count() { } /** * Exchange the array for another one. * * @param array|ArrayObject $data * @return array */ public function exchangeArray($data) { } /** * Creates a copy of the ArrayObject. * * @return array */ public function getArrayCopy() { } /** * Gets the behavior flags. * * @return int */ public function getFlags() { } /** * Create a new iterator from an ArrayObject instance * * @return \Iterator */ public function getIterator() { } /** * Gets the iterator classname for the ArrayObject. * * @return string */ public function getIteratorClass() { } /** * Sort the entries by key * * @return void */ public function ksort() { } /** * Sort an array using a case insensitive "natural order" algorithm * * @return void */ public function natcasesort() { } /** * Sort entries using a "natural order" algorithm * * @return void */ public function natsort() { } /** * Returns whether the requested key exists * * @param mixed $key * @return bool */ public function offsetExists($key) { } /** * Returns the value at the specified key * * @param mixed $key * @return mixed */ public function &offsetGet($key) { } /** * Sets the value at the specified key to value * * @param mixed $key * @param mixed $value * @return void */ public function offsetSet($key, $value) { } /** * Unsets the value at the specified key * * @param mixed $key * @return void */ public function offsetUnset($key) { } /** * Serialize an ArrayObject * * @return string */ public function serialize() { } /** * Sets the behavior flags * * @param int $flags * @return void */ public function setFlags($flags) { } /** * Sets the iterator classname for the ArrayObject * * @param string $class * @return void */ public function setIteratorClass($class) { } /** * Sort the entries with a user-defined comparison function and maintain key association * * @param callable $function * @return void */ public function uasort($function) { } /** * Sort the entries by keys using a user-defined comparison function * * @param callable $function * @return void */ public function uksort($function) { } /** * Unserialize an ArrayObject * * @param string $data * @return void */ public function unserialize($data) { } }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Cannot declare class ArrayObject, because the name is already in use in /in/i0m69 on line 3
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Cannot declare class ArrayObject, because the name is already in use in /in/i0m69 on line 3
Process exited with code 255.
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Fatal error: Cannot redeclare class ArrayObject in /in/i0m69 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Cannot redeclare class arrayobject in /in/i0m69 on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting '{' in /in/i0m69 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting '{' in /in/i0m69 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'{'' in /in/i0m69 on line 3
Process exited with code 255.

preferences:
217.8 ms | 401 KiB | 327 Q