|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-10-07 14:28 UTC] adambaratz@php.net
-Assigned To:
+Assigned To: adambaratz
[2016-10-10 22:16 UTC] adambaratz@php.net
[2016-10-10 22:16 UTC] adambaratz@php.net
-Status: Assigned
+Status: Closed
[2017-01-12 09:12 UTC] krakjoe@php.net
[2018-08-10 21:29 UTC] asherkin at limetech dot io
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
Description: ------------ See test script. I would expect both statements to return NULL. Given the looseness of PHP's type system, this feels appropriate and safer. There's a related issue where numbers can end up treated as strings. Test script: --------------- $db = new PDO(...); $stmt = $db->prepare("SELECT :null"); $stmt->bindValue(':null', null, PDO::PARAM_NULL); $stmt->execute(); var_dump($stmt->fetchAll()); // NULL $stmt = $db->prepare("SELECT :null"); $stmt->bindValue(':null', 0, PDO::PARAM_NULL); $stmt->execute(); var_dump($stmt->fetchAll()); // 0