SimplePie 1.5 is now available!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » API Reference » SimplePie » __destruct()

__destruct()

Description

class SimplePie {
	__destruct ()
}

There is a bug in versions of PHP older than 5.3 where PHP doesn't release memory properly in certain cases. This issue is discussed further in the I'm getting memory leaks! page.

Availability

  • Available since SimplePie 1.1.

Examples

Calling the destructor before unsetting the object reference

<?php
for ($i = 1; $i < 10; $i++)
{
	$feed = new SimplePie();
	$feed->set_feed_url($url);
	$feed->init();
	$feed->handle_content_type();
	$item = $feed->get_item(0); 
 
	$feed->__destruct(); // Do what PHP should be doing on it's own.
	unset($feed); 
 
	echo "Memory usage: " . number_format(memory_get_usage()); 
}
?>

See Also


reference/simplepie/destruct.txt · Last modified: 2011/03/06 03:56 (external edit)