You can use APD (Advanced PHP Debugger) to profile your applications. It is a Zend extension that collects performance statistics during execution of PHP scripts and records them to a file. This file may be analyzed later with the bundled pprofp utility.
APD works by keeping an eye on function calls in your code; each time PHP enters or leaves execution of a function, APD records timing information to a trace file.
After PHP is finished executing the profiled code, you analyze the trace file to determine bottlenecks. This is the interesting part; you quickly learn a lot about your (or other people's) code by analyzing trace files because it gives you a bottom-up view of the application.
You can ...