Doc #66055 [NEW]: PDO::quote does weird conversions with floats

From: Date: Thu, 07 Nov 2013 22:05:09 +0000
Subject: Doc #66055 [NEW]: PDO::quote does weird conversions with floats
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10584@lists.php.net to get a copy of this message
From: llmll at gmx dot de Operating system: any? PHP version: 5.5.5 Package: PDO related Bug Type: Documentation Problem Bug description:PDO::quote does weird conversions with floats Description: ------------ --- From manual page: http://www.php.net/pdo.quote --- The PDO::quote messes around with number formats. The documentation does not mention this. It appears, that quote() checks the variable type, and if it detects a float, it will format it according to the locale. This happens EVEN THOUGH you call quote() without second parameter, which tells it to handle the variables as raw string. Test script: --------------- //string $float = '1.55'; echo PDO::quote($float); // returns '1,55' with point replaced to comma Expected result: ---------------- should either leave strings alone or mention in the documentation, that it does what it does. -- Edit bug report at https://bugs.php.net/bug.php?id=66055&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66055&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66055&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66055&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66055&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66055&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66055&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66055&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66055&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66055&r=support Expected behavior: https://bugs.php.net/fix.php?id=66055&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66055&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66055&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66055&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66055&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66055&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66055&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66055&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66055&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66055&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66055&r=mysqlcfg

« previous php.doc.bugs (#10584) next »