3v4l.org

run code in 300+ PHP versions simultaneously
<?php // unbroken loop function segfault($r) { foreach($r as $v) { segfault($v); } } $directoryIterator = new DirectoryIterator(__DIR__); segfault($directoryIterator);
Output for 7.2.29 - 7.2.30, 7.2.33, 7.3.16 - 7.3.18, 7.3.20 - 7.3.23, 7.3.28 - 7.3.29, 7.4.3 - 7.4.8, 7.4.10, 7.4.16, 7.4.21 - 7.4.22, 7.4.26 - 7.4.33, 8.0.7 - 8.0.9, 8.0.14 - 8.0.30, 8.1.0 - 8.1.1, 8.1.28, 8.2.18, 8.3.5 - 8.3.7
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4096 bytes) in /in/3Obnd on line 4
Process exited with code 255.
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Out of memory (allocated 31457280 bytes) (tried to allocate 262144 bytes) in /in/3Obnd on line 5 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.1.2 - 8.1.27
Fatal error: Out of memory (allocated 31457280) (tried to allocate 262144 bytes) in /in/3Obnd on line 5 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.0.13
Fatal error: Out of memory (allocated 130023424) (tried to allocate 262144 bytes) in /in/3Obnd on line 5 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.0.1, 8.0.5 - 8.0.6, 8.0.10 - 8.0.12
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/in): Failed to open directory: Permission denied in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 7.2.31 - 7.2.32, 7.3.19, 7.3.24 - 7.3.27, 7.4.9, 7.4.11 - 7.4.15, 8.0.0, 8.0.2 - 8.0.3

Process exited with code 137.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.6, 7.3.12, 7.3.30 - 7.3.32, 7.4.0, 7.4.19 - 7.4.20, 7.4.23 - 7.4.25
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/in): failed to open dir: Permission denied in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 7.3.33
Fatal error: Out of memory (allocated 130023424) (tried to allocate 262144 bytes) in /in/3Obnd on line 4 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/in): failed to open dir: Permission denied' in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/3Obnd on line 8 Fatal error: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/3Obnd on line 8 Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/3Obnd on line 8 Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/3Obnd:8 Stack trace: #0 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: directoryiterator in /in/3Obnd on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: directoryiterator in /in/3Obnd on line 8

preferences:
200.41 ms | 401 KiB | 315 Q