Doc #66055 [Fbk->NoF]: PDO::quote does weird conversions with floats

From: Date: Tue, 30 Dec 2014 10:42:06 +0000
Subject: Doc #66055 [Fbk->NoF]: PDO::quote does weird conversions with floats
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11791@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66055&edit=1 ID: 66055 Updated by: php-bugs@lists.php.net Reported by: llmll at gmx dot de Summary: PDO::quote does weird conversions with floats -Status: Feedback +Status: No Feedback Type: Documentation Problem Package: PDO related Operating System: any? PHP Version: 5.5.5 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2013-11-08 15:16:14] willfitch@php.net Please provide more details behind your environment and test script. I've tried this with pdo_mysql using both the string you provided and actual double value with valid results. Also, your call to quote in your test script results in a fatal error in 5.5 as quote is not a static method. ------------------------------------------------------------------------ [2013-11-07 22:05:09] llmll at gmx dot de 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 this bug report at https://bugs.php.net/bug.php?id=66055&edit=1

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