3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Source: https://bugs.php.net/bug.php?id=62468 class SelfLinked { public $xml; public $me; public function __construct() { $this->xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?> <a><b><c><d><e><f><g><h><i><j><k><l><m><n><o><p><q><r><s><t><u><v><w><x><y><z>waa? </z></y></x></w></v></u></t></s></r></q></p></o></n></m></l></k></j></i></h></g></f></e></d></c></b></a>'); $this->me = $this; } } $b = memory_get_usage(); for ($i = 0; $i < 1000; $i++) { new SelfLinked(); gc_collect_cycles(); } var_dump(memory_get_usage() - $b);
Output for 7.0.0 - 7.1.0
int(0)
Output for 5.4.0 - 5.6.29
int(328)
Output for 5.3.11 - 5.3.29
int(368304)
Output for 5.3.3 - 5.3.10
int(368320)
Output for 5.3.0 - 5.3.2
int(288)
Output for 5.2.1 - 5.2.17
Fatal error: Call to undefined function gc_collect_cycles() in /in/dQH9m on line 23
Process exited with code 255.
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/dQH9m on line 18
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/dQH9m on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/dQH9m on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/dQH9m on line 6
Process exited with code 255.