3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $doc = new DOMDocument; $docEl = $doc->appendChild($doc->createElement('foo')); echo memory_get_usage() . "\n"; $docEl->appendChild($doc->createElement('foo')); echo memory_get_usage() . "\n"; $docEl->appendChild($doc->createElement('foo')); echo memory_get_usage() . "\n"; $docEl->appendChild($doc->createElement('foo')); echo memory_get_usage() . "\n"; $docEl->appendChild($doc->createElement('foo')); echo memory_get_usage() . "\n"; $docEl->appendChild($doc->createElement('foo')); echo memory_get_usage() . "\n";
Output for 7.0.0 - 7.1.0
349144 349176 349176 349176 349176 349176
Output for hhvm-3.10.0 - 3.12.0
2097152 2097152 2097152 2097152 2097152 2097152
Output for 5.6.0 - 5.6.28
222376 222424 222424 222424 222424 222424
Output for 5.5.0 - 5.5.38
222376 222408 222408 222408 222408 222408
Output for 5.4.10 - 5.4.45
222896 222928 222928 222928 222928 222928
Output for 5.4.0 - 5.4.9
222368 222400 222400 222400 222400 222400
Output for 5.3.11 - 5.3.29
627760 627792 627792 627792 627792 627792
Output for 5.3.0 - 5.3.10
627456 627488 627488 627488 627488 627488
Output for 5.2.10 - 5.2.17
85392 85424 85424 85424 85424 85424
Output for 5.2.7 - 5.2.9
85928 86304 86304 86304 86304 86304
Output for 5.2.3 - 5.2.6
86248 86624 86624 86624 86624 86624
Output for 5.2.2
84120 84464 84464 84464 84464 84464
Output for 5.2.1
84120 84368 84368 84368 84368 84368
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/9D9F9 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/9D9F9 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/9D9F9 on line 3