Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.14.0

Bug #897 PEAR QA: improvement for get_class()-usage
Submitted: 2004-02-26 14:20 UTC
From: pear-qa at lists dot php dot net Assigned: arnaud
Status: Closed Package: SOAP
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    

 [2004-02-26 14:20 UTC] pear-qa at lists dot php dot net
Description: ------------ ## from the PEAR QA team ## ## quality-assurance related ## Please note that if you don't react to this issue within 4 weeks the PEAR QA-team will take care of it automatically. This is not "rude" but necessary for QA. If this is a "false positive" and your package is not affected please apologize. This package uses get_class()-calls without care for case-sensitivity of the returned classnames. In PHP 4.x the default for getclass() was that lowercase classnames were returned. However, due to extended DOM functionality, PHP 5.x returns classnames with correct upper-and-lowercase. If you intend to run your package under both PHP4 and PHP5 please consider using case-independent comparisons or apply case-fixes. Found in: FILE: '/cvs/php/pear/SOAP/Client.php' : /cvs/php/pear/SOAP/Client.php(175): if (in_array($setter,get_class_methods($this))) { /cvs/php/pear/SOAP/Client.php(179): throw new Exception("$property is not a settable property of ".get_class($this)); /cvs/php/pear/SOAP/Client.php(184): if (in_array($getter,get_class_methods($this))) { /cvs/php/pear/SOAP/Client.php(191): throw new Exception("$property is not a gettable property of ".get_class($this)); ---------------------------------------- FILE: '/cvs/php/pear/SOAP/Schema.php' : /cvs/php/pear/SOAP/Schema.php(213): $classname = get_class($var); /cvs/php/pear/SOAP/Schema.php(238): // XXX is get_class_vars public vars only? That's what I hope! /cvs/php/pear/SOAP/Schema.php(239): $classvars = get_class_vars($classname); ---------------------------------------- FILE: '/cvs/php/pear/SOAP/util.php' : /cvs/php/pear/SOAP/util.php(6): print "PHP Class Type: " . get_class($node) . "/n"; /cvs/php/pear/SOAP/util.php(7): $classname = get_class($node); Reproduce code: --------------- Affected are constructs like: if (get_class($foo) == 'foo') { ... } Possible solutions for correct class-checks: strtolower(get_class($foo)) == 'foo' is_a($foo, 'foo') !strcasecmp(get_class($foo), 'foo')


 [2004-06-09 22:45 UTC] thesaur
arnaud, the return from get_class seems to be passed only to get_class_vars, so I think you can safely close this after making sure I'm right
 [2004-06-10 07:47 UTC] arnaud
This bug is refering to HEAD in cvs. HEAD is a PHP5 only SOAP implementation. This bug report does not apply. I'm closing the bug.