Skip to content

Instantly share code, notes, and snippets.

@sagikazarmark
Created January 2, 2015 11:02
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 sagikazarmark/06b856c94acfb3dbb6e9 to your computer and use it in GitHub Desktop.
Save sagikazarmark/06b856c94acfb3dbb6e9 to your computer and use it in GitHub Desktop.
Tests that the object storage dereferences objects stored
<?php
class foo
{
public function __destruct()
{
echo 'Destructor called';
}
}
$storage = new \SplObjectStorage;
$storage->attach($foo = new foo);
unset($foo);
echo "Unset called\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment