Skip to content

Instantly share code, notes, and snippets.

@ckwalsh
Created March 10, 2015 20:59
Show Gist options
  • Save ckwalsh/2cee4e3d966d47b6cb4c to your computer and use it in GitHub Desktop.
Save ckwalsh/2cee4e3d966d47b6cb4c to your computer and use it in GitHub Desktop.
ckwalsh@ckwalsh:~$ cat a.php
<?php
class FooBar {
public static function run() {
$start = memory_get_usage(true);
$j = 500000;
for ($i = 0; $i < $j; $i++) {
$Store[] = array($i, rand(0,50000000));
}
var_dump(memory_get_usage(true) - $start);
}
}
FooBar::run();
ckwalsh@ckwalsh:~$ php a.php
int(292552704)
ckwalsh@ckwalsh:~$ hhvm a.php
int(36587312)
ckwalsh@ckwalsh:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment