<html> <head> <!--set title--> <title> test declare </title> </head> <!--show page--> <body> <?php function GetTime($bDump = false) { static $arrProfile; if ($bDump) { $temp = $arrProfile; unset($arrProfile); return $temp; } $arrProfile[] = microtime(); } function UseDeclare() { declare(ticks = 2) { for ($i = 0; $i < 50; $i++) { echo similar_text(md5($x), md5($x*$x)), "<br />;"; } } print_r (profile (TRUE)); } //set up a tick handler register_tick_function("GetTime"); //Initilize the function befor the declare block echo GetTime(); UseDeclare(); ?> </body> </html>