Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Dave Marshall's Blog:
Log memory usage using declare and ticks in PHP
May 16, 2008 @ 17:05:37

Posted to his blog, Dave Marshall has a tip that uses declare and a trick or two to check out the memory usage of your scripts.

As far as I know, there isn't any memory footprint profiling in Xdebug, I think there was at some point but they removed it because it was a little flaky. I like to monitor the memory usage within my scripts, and I've found this simple snippet can help.

The script defines a log_memory function that pushes the memory and time information into a session value. The register_tick_function method is used to add log_memory to the handler and its called over and over from inside his for loop.

tagged: log memory usage ticks registertickfunction method session

Link:

YoungCoders.com:
The PHP Construct You've Never Used
Sep 19, 2006 @ 12:38:14

As pointed out by the Zend Developer Zone today, there's a useful forum post over on the YoungCoders.com website that talks about very useful feature that some PHP developers just don't use - ticks.

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.

The post talks about what ticks are, how to enable them, and a few examples of how to use them. Check out more about them in this page on the PHP Manual.

tagged: ticks construct tutorial concept example declare ticks construct tutorial concept example declare

Link:

YoungCoders.com:
The PHP Construct You've Never Used
Sep 19, 2006 @ 12:38:14

As pointed out by the Zend Developer Zone today, there's a useful forum post over on the YoungCoders.com website that talks about very useful feature that some PHP developers just don't use - ticks.

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.

The post talks about what ticks are, how to enable them, and a few examples of how to use them. Check out more about them in this page on the PHP Manual.

tagged: ticks construct tutorial concept example declare ticks construct tutorial concept example declare

Link:


Trending Topics: