3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Node { private $next; public function setNext(Node $node = null) { $this->next = $node; return $this; } } class LinkedList { private $head; public function addNode() { $this->head = (new Node())->setNext($this->head); } } $ll = new LinkedList(); for ($i = 0; $i < 3150000; $i++) { $ll->addNode(); } echo "done no probs";
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.1, 8.1.28 - 8.1.29, 8.2.18 - 8.2.20, 8.3.5 - 8.3.8
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4096 bytes) in /in/vr2a8 on line 16
Process exited with code 255.
Output for 8.3.0 - 8.3.4
Fatal error: Out of memory (allocated 29360128 bytes) (tried to allocate 4096 bytes) in /in/vr2a8 on line 16 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.0 - 8.2.17
Fatal error: Out of memory (allocated 31457280 bytes) (tried to allocate 4096 bytes) in /in/vr2a8 on line 16 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 4096 bytes) in /in/vr2a8 on line 16 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 8.0.13
Fatal error: Out of memory (allocated 127926272) (tried to allocate 4096 bytes) in /in/vr2a8 on line 16 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 7.0.0 - 7.0.3, 7.0.6 - 7.0.7
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4096 bytes) in /in/vr2a8 on line 16
Process exited with code 139.
Output for 7.0.4 - 7.0.5

Process exited with code 137.
Output for 5.5.0 - 5.5.36, 5.6.0 - 5.6.22
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 33554432 bytes) in /in/vr2a8 on line 16
Process exited with code 139.

preferences:
175.25 ms | 402 KiB | 211 Q