3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument('1.0'); for ($i=0; $i<=1000000; ++$i) { $root = $dom->createElement('message'); $dom->appendChild($root); $content = $dom->createElement('content'); $root->appendChild($content); $content->appendChild($dom->createTextNode('Example content baz')); }
Output for 8.1.10, 8.1.16 - 8.1.20, 8.2.3, 8.2.12 - 8.2.15, 8.2.18, 8.3.3, 8.3.5 - 8.3.6
Warning: DOMDocument::createElement(): Memory allocation failed : building node in /in/YTE0k on line 6 Fatal error: Uncaught DOMException: Invalid State Error in /in/YTE0k:6 Stack trace: #0 /in/YTE0k(6): DOMDocument->createElement('content') #1 {main} thrown in /in/YTE0k on line 6
Process exited with code 255.
Output for 8.1.25 - 8.1.27, 8.2.8 - 8.2.9, 8.2.16, 8.3.4
Warning: DOMDocument::createElement(): Memory allocation failed in /in/YTE0k on line 4 Warning: DOMDocument::createElement(): Memory allocation failed in /in/YTE0k on line 6 Fatal error: Uncaught DOMException: Invalid State Error in /in/YTE0k:6 Stack trace: #0 /in/YTE0k(6): DOMDocument->createElement('content') #1 {main} thrown in /in/YTE0k on line 6
Process exited with code 255.
Output for 8.1.5 - 8.1.9, 8.3.0 - 8.3.2
Warning: DOMDocument::createElement(): Memory allocation failed in /in/YTE0k on line 6 Warning: DOMDocument::createTextNode(): Memory allocation failed in /in/YTE0k on line 8 Fatal error: Uncaught DOMException: Invalid State Error in /in/YTE0k:8 Stack trace: #0 /in/YTE0k(8): DOMDocument->createTextNode('Example content...') #1 {main} thrown in /in/YTE0k on line 8
Process exited with code 255.
Output for 8.1.0 - 8.1.1, 8.1.21, 8.2.10 - 8.2.11, 8.2.17
Warning: DOMDocument::createElement(): Memory allocation failed : building node in /in/YTE0k on line 4 Fatal error: Uncaught DOMException: Invalid State Error in /in/YTE0k:4 Stack trace: #0 /in/YTE0k(4): DOMDocument->createElement('message') #1 {main} thrown in /in/YTE0k on line 4
Process exited with code 255.
Output for 8.2.4 - 8.2.7
Warning: DOMDocument::createTextNode(): Memory allocation failed in /in/YTE0k on line 8 Fatal error: Uncaught DOMException: Invalid State Error in /in/YTE0k:8 Stack trace: #0 /in/YTE0k(8): DOMDocument->createTextNode('Example content...') #1 {main} thrown in /in/YTE0k on line 8
Process exited with code 255.
Output for 8.1.2 - 8.1.4, 8.1.11 - 8.1.15, 8.2.0 - 8.2.2
Warning: DOMDocument::createTextNode(): Memory allocation failed : building text in /in/YTE0k on line 8 Fatal error: Uncaught DOMException: Invalid State Error in /in/YTE0k:8 Stack trace: #0 /in/YTE0k(8): DOMDocument->createTextNode('Example content...') #1 {main} thrown in /in/YTE0k on line 8
Process exited with code 255.
Output for 8.1.28
Warning: DOMDocument::createTextNode(): Memory allocation failed in /in/YTE0k on line 8 Warning: DOMDocument::createElement(): Memory allocation failed in /in/YTE0k on line 4 Fatal error: Uncaught DOMException: Invalid State Error in /in/YTE0k:4 Stack trace: #0 /in/YTE0k(4): DOMDocument->createElement('message') #1 {main} thrown in /in/YTE0k on line 4
Process exited with code 255.
Output for 8.1.22 - 8.1.24
Warning: DOMDocument::createElement(): Memory allocation failed in /in/YTE0k on line 4 Fatal error: Uncaught DOMException: Invalid State Error in /in/YTE0k:4 Stack trace: #0 /in/YTE0k(4): DOMDocument->createElement('message') #1 {main} thrown in /in/YTE0k on line 4
Process exited with code 255.
Output for 8.0.0, 8.0.5 - 8.0.6, 8.0.10 - 8.0.12, 8.0.28 - 8.0.30
Fatal error: Uncaught TypeError: DOMNode::appendChild(): Argument #1 ($node) must be of type DOMNode, bool given in /in/YTE0k:7 Stack trace: #0 /in/YTE0k(7): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 7
Process exited with code 255.
Output for 8.0.14 - 8.0.27
Fatal error: Uncaught TypeError: DOMNode::appendChild(): Argument #1 ($node) must be of type DOMNode, bool given in /in/YTE0k:8 Stack trace: #0 /in/YTE0k(8): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 8
Process exited with code 255.
Output for 8.0.1 - 8.0.3, 8.0.7 - 8.0.9, 8.0.13
Fatal error: Uncaught TypeError: DOMNode::appendChild(): Argument #1 ($node) must be of type DOMNode, bool given in /in/YTE0k:5 Stack trace: #0 /in/YTE0k(5): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 5
Process exited with code 255.
Output for 7.3.4, 7.3.10 - 7.3.12, 7.3.18, 7.4.4 - 7.4.5, 7.4.23 - 7.4.25, 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, bool given in /in/YTE0k:8 Stack trace: #0 /in/YTE0k(8): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 8
Process exited with code 255.
Output for 7.3.0 - 7.3.2, 7.3.8 - 7.3.9, 7.4.7 - 7.4.15, 7.4.26 - 7.4.32
Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, bool given in /in/YTE0k:5 Stack trace: #0 /in/YTE0k(5): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 5
Process exited with code 255.
Output for 7.3.3, 7.3.5 - 7.3.7, 7.3.16 - 7.3.17, 7.3.19 - 7.3.21, 7.3.24 - 7.3.33, 7.4.0 - 7.4.3, 7.4.6, 7.4.16 - 7.4.22
Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, bool given in /in/YTE0k:7 Stack trace: #0 /in/YTE0k(7): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 7
Process exited with code 255.
Output for 7.3.23
Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, bool given in /in/YTE0k:7 Stack trace: #0 /in/YTE0k(7): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 7
Process exited with code 137.
Output for 7.0.0 - 7.0.2, 7.0.10, 7.0.20, 7.1.7, 7.1.25 - 7.1.26, 7.1.31 - 7.1.33, 7.2.21 - 7.2.33
Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, boolean given in /in/YTE0k:5 Stack trace: #0 /in/YTE0k(5): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 5
Process exited with code 255.
Output for 7.0.6 - 7.0.9, 7.1.5, 7.1.20, 7.2.7 - 7.2.9, 7.2.17 - 7.2.20
Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, boolean given in /in/YTE0k:7 Stack trace: #0 /in/YTE0k(7): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 7
Process exited with code 255.
Output for 7.0.3 - 7.0.5, 7.0.14, 7.1.0, 7.1.6, 7.1.27 - 7.1.30, 7.2.0 - 7.2.6, 7.2.10 - 7.2.16
Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, boolean given in /in/YTE0k:8 Stack trace: #0 /in/YTE0k(8): DOMNode->appendChild(false) #1 {main} thrown in /in/YTE0k on line 8
Process exited with code 255.
Output for 5.2.8, 5.2.10, 5.2.12 - 5.2.17, 5.3.0 - 5.3.6, 5.3.27 - 5.3.28, 5.4.1 - 5.4.4, 5.4.7 - 5.4.11, 5.4.17, 5.4.44 - 5.4.45, 5.5.0, 5.5.5, 5.5.8 - 5.5.11, 5.5.22, 5.5.28 - 5.5.34, 5.6.1 - 5.6.2, 5.6.5, 5.6.21, 5.6.24, 5.6.28
Catchable fatal error: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, boolean given in /in/YTE0k on line 8
Process exited with code 255.
Output for 5.2.6 - 5.2.7, 5.2.11, 5.3.7 - 5.3.8, 5.3.14, 5.3.29, 5.4.0, 5.4.6, 5.4.12 - 5.4.14, 5.5.12 - 5.5.21, 5.5.23 - 5.5.27, 5.6.0, 5.6.6 - 5.6.11, 5.6.18 - 5.6.20, 5.6.23, 5.6.25
Catchable fatal error: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, boolean given in /in/YTE0k on line 7
Process exited with code 255.
Output for 5.2.9, 5.3.9 - 5.3.13, 5.3.15 - 5.3.26, 5.4.5, 5.4.15 - 5.4.16, 5.4.18 - 5.4.43, 5.5.1 - 5.5.4, 5.5.6 - 5.5.7, 5.5.35 - 5.5.38, 5.6.3 - 5.6.4, 5.6.12 - 5.6.17, 5.6.22
Catchable fatal error: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, boolean given in /in/YTE0k on line 5
Process exited with code 255.
Output for 5.2.3 - 5.2.5
Warning: DOMNode::appendChild() expects parameter 1 to be DOMNode, boolean given in /in/YTE0k on line 5 Fatal error: Call to a member function appendChild() on a non-object in /in/YTE0k on line 7
Process exited with code 255.
Output for 5.2.2
Warning: DOMNode::appendChild() expects parameter 1 to be DOMNode, boolean given in /in/YTE0k on line 8 Warning: DOMNode::appendChild() expects parameter 1 to be DOMNode, boolean given in /in/YTE0k on line 5 Fatal error: Call to a member function appendChild() on a non-object in /in/YTE0k on line 7
Process exited with code 255.
Output for 5.2.0 - 5.2.1
Warning: DOMNode::appendChild() expects parameter 1 to be DOMNode, boolean given in /in/YTE0k on line 7 Fatal error: Call to a member function appendChild() on a non-object in /in/YTE0k on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6

Process exited with code 137.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/YTE0k on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/YTE0k on line 2

preferences:
255.29 ms | 401 KiB | 399 Q