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

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


 [2004-02-26 14:03 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/Math_Quaternion/QuaternionOp.php' : /cvs/php/pear/Math_Quaternion/QuaternionOp.php(115): return (get_class($q1) == 'math_quaternion' 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-04-10 02:09 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!