note 90166 added to function.get-called-class

From: Date: Wed, 08 Apr 2009 18:13:10 +0000
Subject: note 90166 added to function.get-called-class
Groups: php.notes 
Request: Send a blank email to php-notes+get-152969@lists.php.net to get a copy of this message
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']); } } ?> ---- Server IP: 213.92.11.19 Probable Submitter: 85.20.140.157 ---- Manual Page -- http://www.php.net/manual/en/function.get-called-class.php Edit -- https://master.php.net/note/edit/90166 Del: integrated -- https://master.php.net/note/delete/90166/integrated Del: useless -- https://master.php.net/note/delete/90166/useless Del: bad code -- https://master.php.net/note/delete/90166/bad+code Del: spam -- https://master.php.net/note/delete/90166/spam Del: non-english -- https://master.php.net/note/delete/90166/non-english Del: in docs -- https://master.php.net/note/delete/90166/in+docs Del: other reasons-- https://master.php.net/note/delete/90166 Reject -- https://master.php.net/note/reject/90166 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152969) next »