note 46108 deleted from function.get-class by tomsommer

From: Date: Wed, 29 Sep 2004 23:17:08 +0000
Subject: note 46108 deleted from function.get-class by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-77596@lists.php.net to get a copy of this message
Note Submitter: jamieNO at SPsoundepartment dot AMcom ---- As the previous poster states, this function returns the class name in lowercase, and this can break a class comparison. For example, if you run this: <?php class testClass { var $myVar; } function testForClass($aTestObject) { if (get_class($sTestObject) == "testClass") return TRUE; else return FALSE; } $myObj = new testClass; testForClass($myObj); ?> running this code will return FALSE, since the "==" operator is case sensitive.

« previous php.notes (#77596) next »