note 90166 deleted from function.get-called-class by danbrown
| From: | danbrown@php.net | Date: | Wed, 08 Apr 2009 18:15:14 +0000 |
| Subject: | note 90166 deleted from function.get-called-class by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152970@lists.php.net to get a copy of this message | ||
Note Submitter: daniele at l33t dot it
----
I tried that implementation and it didn't work for me, on the other hand the following code
did. I have no idea of the why.
<?php
if (!function_exists('get_called_class')){
function get_called_class(){
$bt = debug_backtrace();
return get_class($bt[1]['object']);
}
}
?>