Real time use of PHP Magic Methods __sleep and __wakeup
===

Just eager to know that what is the real time use of `__sleep` and `__wakeup` in PHP? I read the php documentation but not cleared.

	class sleepWakeup
	{

		public function __construct()
		{
			// constructor //
		}

		public function __sleep()
		{
			echo 'it is sleep.';
		}

		public function __wakeup()
		{
			echo 'it is wakeup.';
		}

	}

	$ob = new sleepWakeup();

	// call __sleep method
	echo $ob->__sleep();

	echo "\n";

	// call __wakeup method
	echo $ob->__wakeup();

example code prints

	it is sleep.
	it is wakeup.

If the methods are not `__sleep` and `__wakeup` or they are `foo` and `bar` then also it prints the same. Then what is the use of these two methods?