note 94527 added to function.get-called-class

From: Date: Tue, 10 Nov 2009 11:35:19 +0000
Subject: note 94527 added to function.get-called-class
Groups: php.notes 
Request: Send a blank email to php-notes+get-162694@lists.php.net to get a copy of this message
i have a small fix for the get_called_class method for php versions prior php 5.3 by "laurence+nospam at sol1 dot com dot au" which i made for a script at easy-coding.de since method calls are caseinsensitive you should use stripos instead of strpos. Otherwise you will end up with a "Undefined offset: -1" notice and the error "Could not find caller class." See Line #23 <? } while (stripos($callerLine,$bt[$l]['function']) === false); ?> ---- Server IP: 212.124.37.9 Probable Submitter: 87.153.234.122 ---- Manual Page -- http://www.php.net/manual/en/function.get-called-class.php Edit -- https://master.php.net/note/edit/94527 Del: integrated -- https://master.php.net/note/delete/94527/integrated Del: useless -- https://master.php.net/note/delete/94527/useless Del: bad code -- https://master.php.net/note/delete/94527/bad+code Del: spam -- https://master.php.net/note/delete/94527/spam Del: non-english -- https://master.php.net/note/delete/94527/non-english Del: in docs -- https://master.php.net/note/delete/94527/in+docs Del: other reasons-- https://master.php.net/note/delete/94527 Reject -- https://master.php.net/note/reject/94527 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#162694) next »