3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $foo; public function __construct() { unset($this->foo); } } $foo = new Foo(); $foo->foo = 'foo'; var_dump(memory_get_usage());
Output for 7.4.0 - 7.4.1
int(388008)
Output for 7.3.0 - 7.3.13
int(387960)
Output for 7.2.0 - 7.2.26
int(384064)
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
int(347328)
Output for 5.6.0 - 5.6.40
int(220016)
Output for 5.5.0 - 5.5.38
int(220008)
Output for 5.4.0 - 5.4.45
int(220520)
Output for 5.3.11 - 5.3.29
int(621672)
Output for 5.3.0 - 5.3.10
int(621368)
Output for 5.2.10 - 5.2.17
int(80104)
Output for 5.2.7 - 5.2.9
int(80832)
Output for 5.2.3 - 5.2.6
int(81152)
Output for 5.2.1 - 5.2.2
int(79048)
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/MDLZn on line 15
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/MDLZn on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/MDLZn on line 5
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/MDLZn on line 5
Process exited with code 255.

preferences:
255.72 ms | 401 KiB | 325 Q