p. Nope, not the creepy crawly kind that give you “all kinds of nastiness”:http://www.wbir.com/news/local/story.aspx?storyid=37197, the “PHP kind”:http://www.php.net/manual/en/control-structures.declare.php#control-structures.declare.ticks. Mau, one of the co-moderators over at “youngcoders.com”:http://www.youngcoders.com/index.php gives a “good description”:http://www.youngcoders.com/showthread.php?s=73009e212b26a70c3a01354b4fd9b2a2&p=95601#post95601 of TICKS and some sample code to boot. From the article:
bq. You’ve probably never used it, never saw it, or never found a practical use for ticks, a underused and powerful feature of PHP that allows you to implement exceptions in PHP4, do intensive debugging and profiling, check database connections, turn PHP into an event driven language, or harness complex control over your code.
p. Mau then goes on to show sample code and how to implement ticks. He (she?) talks about why the concept behind ticks is not totally useless as one might think. He gives several examples of when it might be useful beyond just a debugging or profiling scenario. One (but not all) of the examples he gives is:
bq. Writing something that checks to see if the database connection has been dropped. If so, throw an exception or handle it somehow.
p. You’ll have to visit the article to get the full story. It’s worth the 5 minutes of your life though. Don’t be fooled by the URL. Yes, the target audience is Young Coders but that doesn’t mean old geezers like myself can’t learn a thing or two from them as well. Who knows, maybe *you* even will learn something.
p. Oh, at the very bottom of the article is a bit of very important advice:
bq. Avoid using this on Apache with Windows — there have been reports of system crashes.
p. You have been warned. :)