PHP Runtime Debugger (Was: [PHP] how to count objects instances)
| From: | Michal Migurski | Date: | Mon, 23 Aug 2004 22:51:43 +0000 |
| Subject: | PHP Runtime Debugger (Was: [PHP] how to count objects instances) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194537@lists.php.net to get a copy of this message | ||
> There's no predefined variable or method for determining this, that I'm
> aware of, short of counting how many "new Test" lines you have.
>
> You could write a wrapper class for Test that kept count of the
> instances and returned a new object upon request...
A slightly more general question: are there any PHP development
environments that let you do something like a core dump, to see what kind
of memory usage or variable allocation you have going on? Maybe a
compilation option to PHP? A search of google turns up DBG and some
commercial packages, but I lack the experience with such tools to evaluate
them intelligently.
I've done something like what the OP is asking about, by adding a log()
feature and calling it when objects are instantiated or destroyed, but it
sure would be nice to see something like this built-in.
I'm a gdb beginner, but I'm willing to learn. I realize that this is a
fairly complex problem compounded by the fact that PHP is generally a
library used within an apache child process.
Any thoughts?
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html