--TEST-- SplObjectStorage unset and destructor edge cases --FILE-- getMessage()}\n"; } var_dump($s); $s[$o] = new HasDestructor(); try { $s->offsetUnset($o); } catch (Exception $e) { echo "Caught: {$e->getMessage()}\n"; } var_dump($s); ?> --EXPECT-- In destructor. Should no longer be accessible in $s: object(SplObjectStorage)#2 (1) { ["storage":"SplObjectStorage":private]=> array(0) { } } Caught: thrown from destructor object(SplObjectStorage)#2 (1) { ["storage":"SplObjectStorage":private]=> array(0) { } } In destructor. Should no longer be accessible in $s: object(SplObjectStorage)#2 (1) { ["storage":"SplObjectStorage":private]=> array(0) { } } Caught: thrown from destructor object(SplObjectStorage)#2 (1) { ["storage":"SplObjectStorage":private]=> array(0) { } }