3v4l.org

run code in 500+ PHP versions simultaneously
<?php set_error_handler(function () { throw new Exception("foo"); }); class MyArrayAcess implements ArrayAccess { public function offsetExists(mixed $offset): mixed {} public function offsetGet(mixed $offset): mixed {} public function offsetSet(mixed $offset, mixed $value): void {} public function offsetUnset(mixed $offset): void {} }
Output for 8.5.0 - 8.5.9
Fatal error: Uncaught Exception: foo in /in/6sbhF:4 Stack trace: #0 /in/6sbhF(7): {closure:/in/6sbhF:3}(8192, 'Return type of ...', '/in/6sbhF', 8) #1 {main} thrown in /in/6sbhF on line 4
Process exited with code 255.
Output for 8.4.1 - 8.4.24
Fatal error: During inheritance of ArrayAccess: Uncaught Exception: foo in /in/6sbhF:4 Stack trace: #0 /in/6sbhF(7): {closure:/in/6sbhF:3}(8192, 'Return type of ...', '/in/6sbhF', 8) #1 {main} in /in/6sbhF on line 7
Process exited with code 255.
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.33, 8.3.0 - 8.3.33
Fatal error: During inheritance of ArrayAccess: Uncaught Exception: foo in /in/6sbhF:4 Stack trace: #0 /in/6sbhF(7): {closure}(8192, 'Return type of ...', '/in/6sbhF', 8) #1 {main} in /in/6sbhF on line 7
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Output for 7.4.0 - 7.4.33
Fatal error: Declaration of MyArrayAcess::offsetExists(mixed $offset): mixed must be compatible with ArrayAccess::offsetExists($offset) in /in/6sbhF on line 8
Process exited with code 255.
Output for 7.3.0 - 7.3.33
Fatal error: Declaration of MyArrayAcess::offsetExists(mixed $offset): mixed must be compatible with ArrayAccess::offsetExists($offset) in /in/6sbhF on line 7
Process exited with code 255.

preferences:
51.06 ms | 1479 KiB | 4 Q