note 51797 deleted from language.oop5.magic by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 06:46:49 +0000 |
| Subject: | note 51797 deleted from language.oop5.magic by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196635@lists.php.net to get a copy of this message | ||
Note Submitter: elias
----
The default toString output is very useful for visual debuggin
because it shows the object id.
There is no function to resolve the id directly(?), but you
can do this:
<?php
function __toString()
{
sscanf((string)$this, "Object id #%d", $id);
return "Object(Template) id #$id";
}
?>
HTH,
elias