3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class FOO { public $f; } class BAR { public $f; } for ($i = 0; $i < 100; $i++) { $a = new FOO(); $b = new BAR(); $a->f = $b; $b->f = $a; print "Memory usage: " . number_format(memory_get_usage(true)) . " bytes\n"; unset($a); unset($b); }
Output for 7.0.0 - 7.2.0
Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes Memory usage: 2,097,152 bytes
Output for 5.2.1 - 5.2.17, 5.4.0 - 5.6.28
Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes Memory usage: 262,144 bytes
Output for 5.3.0 - 5.3.29
Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes Memory usage: 786,432 bytes
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/a93oe on line 16
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/a93oe on line 4
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/a93oe on line 4
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/a93oe on line 4
Process exited with code 255.