Skip to content

Instantly share code, notes, and snippets.

@vinothbabu
Created November 1, 2013 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinothbabu/7259456 to your computer and use it in GitHub Desktop.
Save vinothbabu/7259456 to your computer and use it in GitHub Desktop.
circular references
<?php
class Vinoth {
public $f;
}
class Kevin {
public $f;
}
while(1){
$a = new Vinoth;
$b = new Kevin;
$a->f = $b;
$b->f = $a;
echo "Memory usage" .number_format(memory_get_usage(true)) . " bytes\n";
unset($a);
unset($b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment