Created
January 25, 2014 20:08
-
-
Save asm89/8622724 to your computer and use it in GitHub Desktop.
Memory leak in hhvm?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo | |
{ | |
private $bar; | |
public function __construct(Bar $bar) | |
{ | |
$this->bar = $bar; | |
} | |
} | |
class Bar | |
{ | |
private $foo; | |
public function setFoo(Foo $foo) | |
{ | |
$this->foo = $foo; | |
} | |
} | |
while(true) { | |
$bar = new Bar(); | |
$foo = new Foo($bar); | |
$bar->setFoo($foo); | |
echo memory_get_usage() . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment