3v4l.org

run code in 300+ PHP versions simultaneously
<?php preg_replace(array_fill(0, 10, '/()/'),str_repeat("&", 10),NULL);
Output for 8.1.2
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/LnV37 on line 2 Fatal error: Out of memory (allocated 15732736) (tried to allocate 23068696 bytes) in /in/LnV37 on line 2 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.1.0 - 8.1.1
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/LnV37 on line 2 Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 46137368 bytes) in /in/LnV37 on line 2
Process exited with code 255.
Output for 7.4.22 - 7.4.27, 8.0.9 - 8.0.12, 8.0.14 - 8.0.15
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 46137368 bytes) in /in/LnV37 on line 2
Process exited with code 255.
Output for 8.0.13
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 92274712 bytes) in /in/LnV37 on line 2
Process exited with code 255.
Output for 7.1.0 - 7.1.22, 7.2.0 - 7.2.10, 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.4 - 7.4.21, 8.0.0 - 8.0.8
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 35002856 bytes) in /in/LnV37 on line 2
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 105008528 bytes) in /in/LnV37 on line 2
Process exited with code 255.
Output for 7.1.23 - 7.1.24, 7.2.11 - 7.2.12

Process exited with code 137.
Output for 5.6.38
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 38974341 bytes) in /in/LnV37 on line 2
Process exited with code 255.

preferences:
45.42 ms | 469 KiB | 5 Q