3v4l.org

run code in 150+ 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.1.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 hhvm-3.12.0
Memory usage: 307,808 bytes Memory usage: 307,888 bytes Memory usage: 307,968 bytes Memory usage: 308,048 bytes Memory usage: 308,128 bytes Memory usage: 308,208 bytes Memory usage: 308,288 bytes Memory usage: 308,368 bytes Memory usage: 308,448 bytes Memory usage: 308,528 bytes Memory usage: 308,608 bytes Memory usage: 308,688 bytes Memory usage: 308,768 bytes Memory usage: 308,848 bytes Memory usage: 308,928 bytes Memory usage: 309,008 bytes Memory usage: 309,088 bytes Memory usage: 309,168 bytes Memory usage: 309,248 bytes Memory usage: 309,328 bytes Memory usage: 309,408 bytes Memory usage: 309,488 bytes Memory usage: 309,568 bytes Memory usage: 309,648 bytes Memory usage: 309,728 bytes Memory usage: 309,808 bytes Memory usage: 309,888 bytes Memory usage: 309,968 bytes Memory usage: 310,048 bytes Memory usage: 310,128 bytes Memory usage: 310,208 bytes Memory usage: 310,288 bytes Memory usage: 310,368 bytes Memory usage: 310,448 bytes Memory usage: 310,528 bytes Memory usage: 310,608 bytes Memory usage: 310,688 bytes Memory usage: 310,768 bytes Memory usage: 310,848 bytes Memory usage: 310,928 bytes Memory usage: 311,008 bytes Memory usage: 311,088 bytes Memory usage: 311,168 bytes Memory usage: 311,248 bytes Memory usage: 311,328 bytes Memory usage: 311,408 bytes Memory usage: 311,488 bytes Memory usage: 311,568 bytes Memory usage: 311,648 bytes Memory usage: 311,728 bytes Memory usage: 311,808 bytes Memory usage: 311,888 bytes Memory usage: 311,968 bytes Memory usage: 312,048 bytes Memory usage: 312,128 bytes Memory usage: 312,208 bytes Memory usage: 312,288 bytes Memory usage: 312,368 bytes Memory usage: 312,448 bytes Memory usage: 312,528 bytes Memory usage: 312,608 bytes Memory usage: 312,688 bytes Memory usage: 312,768 bytes Memory usage: 312,848 bytes Memory usage: 312,928 bytes Memory usage: 313,008 bytes Memory usage: 313,088 bytes Memory usage: 313,168 bytes Memory usage: 313,248 bytes Memory usage: 313,328 bytes Memory usage: 313,408 bytes Memory usage: 313,488 bytes Memory usage: 313,568 bytes Memory usage: 313,648 bytes Memory usage: 313,728 bytes Memory usage: 313,808 bytes Memory usage: 313,888 bytes Memory usage: 313,968 bytes Memory usage: 314,048 bytes Memory usage: 314,128 bytes Memory usage: 314,208 bytes Memory usage: 314,288 bytes Memory usage: 314,368 bytes Memory usage: 314,448 bytes Memory usage: 314,528 bytes Memory usage: 314,608 bytes Memory usage: 314,688 bytes Memory usage: 314,768 bytes Memory usage: 314,848 bytes Memory usage: 314,928 bytes Memory usage: 315,008 bytes Memory usage: 315,088 bytes Memory usage: 315,168 bytes Memory usage: 315,248 bytes Memory usage: 315,328 bytes Memory usage: 315,408 bytes Memory usage: 315,488 bytes Memory usage: 315,568 bytes Memory usage: 315,648 bytes Memory usage: 315,728 bytes
Output for hhvm-3.10.0
Memory usage: 306,184 bytes Memory usage: 306,264 bytes Memory usage: 306,344 bytes Memory usage: 306,424 bytes Memory usage: 306,504 bytes Memory usage: 306,584 bytes Memory usage: 306,664 bytes Memory usage: 306,744 bytes Memory usage: 306,824 bytes Memory usage: 306,904 bytes Memory usage: 306,984 bytes Memory usage: 307,064 bytes Memory usage: 307,144 bytes Memory usage: 307,224 bytes Memory usage: 307,304 bytes Memory usage: 307,384 bytes Memory usage: 307,464 bytes Memory usage: 307,544 bytes Memory usage: 307,624 bytes Memory usage: 307,704 bytes Memory usage: 307,784 bytes Memory usage: 307,864 bytes Memory usage: 307,944 bytes Memory usage: 308,024 bytes Memory usage: 308,104 bytes Memory usage: 308,184 bytes Memory usage: 308,264 bytes Memory usage: 308,344 bytes Memory usage: 308,424 bytes Memory usage: 308,504 bytes Memory usage: 308,584 bytes Memory usage: 308,664 bytes Memory usage: 308,744 bytes Memory usage: 308,824 bytes Memory usage: 308,904 bytes Memory usage: 308,984 bytes Memory usage: 309,064 bytes Memory usage: 309,144 bytes Memory usage: 309,224 bytes Memory usage: 309,304 bytes Memory usage: 309,384 bytes Memory usage: 309,464 bytes Memory usage: 309,544 bytes Memory usage: 309,624 bytes Memory usage: 309,704 bytes Memory usage: 309,784 bytes Memory usage: 309,864 bytes Memory usage: 309,944 bytes Memory usage: 310,024 bytes Memory usage: 310,104 bytes Memory usage: 310,184 bytes Memory usage: 310,264 bytes Memory usage: 310,344 bytes Memory usage: 310,424 bytes Memory usage: 310,504 bytes Memory usage: 310,584 bytes Memory usage: 310,664 bytes Memory usage: 310,744 bytes Memory usage: 310,824 bytes Memory usage: 310,904 bytes Memory usage: 310,984 bytes Memory usage: 311,064 bytes Memory usage: 311,144 bytes Memory usage: 311,224 bytes Memory usage: 311,304 bytes Memory usage: 311,384 bytes Memory usage: 311,464 bytes Memory usage: 311,544 bytes Memory usage: 311,624 bytes Memory usage: 311,704 bytes Memory usage: 311,784 bytes Memory usage: 311,864 bytes Memory usage: 311,944 bytes Memory usage: 312,024 bytes Memory usage: 312,104 bytes Memory usage: 312,184 bytes Memory usage: 312,264 bytes Memory usage: 312,344 bytes Memory usage: 312,424 bytes Memory usage: 312,504 bytes Memory usage: 312,584 bytes Memory usage: 312,664 bytes Memory usage: 312,744 bytes Memory usage: 312,824 bytes Memory usage: 312,904 bytes Memory usage: 312,984 bytes Memory usage: 313,064 bytes Memory usage: 313,144 bytes Memory usage: 313,224 bytes Memory usage: 313,304 bytes Memory usage: 313,384 bytes Memory usage: 313,464 bytes Memory usage: 313,544 bytes Memory usage: 313,624 bytes Memory usage: 313,704 bytes Memory usage: 313,784 bytes Memory usage: 313,864 bytes Memory usage: 313,944 bytes Memory usage: 314,024 bytes Memory usage: 314,104 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.