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

Bug #887 PEAR QA: improvement for get_class()-usage
Submitted: 2004-02-26 14:05 UTC
From: pear-qa at lists dot php dot net Assigned:
Status: Bogus Package: MDB
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 9 + 1 = ?

 
 [2004-02-26 14:05 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/MDB/MDB.php' : /cvs/php/pear/MDB/MDB.php(402): && (get_class($value) == 'mdb_error' ---------------------------------------- FILE: '/cvs/php/pear/MDB/MDB/Common.php' : /cvs/php/pear/MDB/MDB/Common.php(288): $info = get_class($this); ---------------------------------------- FILE: '/cvs/php/pear/MDB/tests/Console_TestListener.php' : /cvs/php/pear/MDB/tests/Console_TestListener.php(29): echo(get_class($test).' : Starting '.$test->getName().' ...'); ---------------------------------------- FILE: '/cvs/php/pear/MDB/tests/HTML_TestListener.php' : /cvs/php/pear/MDB/tests/HTML_TestListener.php(30): echo("/n<div class=/"testcase/">".get_class($test).' : Starting '.$test->getName().' ...'); ---------------------------------------- FILE: '/cvs/php/pear/MDB/tests/MDB_api_testcase.php' : /cvs/php/pear/MDB/tests/MDB_api_testcase.php(108): if (array_key_exists(strtolower($name), array_flip(get_class_methods($this->db)))) { /cvs/php/pear/MDB/tests/MDB_api_testcase.php(111): $this->assertTrue(false, 'method '. $name.' not implemented in '.get_class($this->db)); ---------------------------------------- FILE: '/cvs/php/pear/MDB/tests/MDB_manager_testcase.php' : /cvs/php/pear/MDB/tests/MDB_manager_testcase.php(98): && array_key_exists(strtolower($name), array_flip(get_class_methods($class))) /cvs/php/pear/MDB/tests/MDB_manager_testcase.php(102): $this->assertTrue(false, 'method '. $name.' not implemented in '.get_class($class)); ---------------------------------------- FILE: '/cvs/php/pear/MDB/tests/MDB_usage_testcase.php' : /cvs/php/pear/MDB/tests/MDB_usage_testcase.php(110): if (array_key_exists(strtolower($name), array_flip(get_class_methods($this->db)))) { /cvs/php/pear/MDB/tests/MDB_usage_testcase.php(113): $this->assertTrue(false, 'method '. $name.' not implemented in '.get_class($this->db)); ---------------------------------------- FILE: '/cvs/php/pear/MDB/tests/testUtils.php' : /cvs/php/pear/MDB/tests/testUtils.php(20): $methods = get_class_methods($class); 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')

Comments

 [2004-02-26 14:14 UTC] lsmith
this code is deprecated .. the current code is in the MDB_1 branch