|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2013-04-27 16:35 UTC] vrana@php.net
 
-Package: PDO related
+Package: Documentation problem
  [2013-04-27 16:35 UTC] vrana@php.net
  [2013-04-27 16:37 UTC] vrana@php.net
  [2013-04-27 16:38 UTC] vrana@php.net
 
-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: vrana
  [2013-04-27 16:38 UTC] vrana@php.net
  [2020-02-07 06:08 UTC] phpdocbot@php.net
 | |||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 14:00:01 2025 UTC | 
Description: ------------ Suppose MySQL database with a column of type bit(1). Then fetching value from this column gives a binary string ("\0", "\1") in PHP5.3 and numeric string ("0", "1") in 5.4. I'd expect to obtain a boolean, but numeric string would be a good enough. But it must be consistent in both PHP versions. Test script: --------------- $res = $connection->query("SELECT * FROM bittest"); $row = $res->fetch(); dump($row); Assert::same(0, $row->id); Assert::same(false, $row->flag); $row = $res->fetch(); dump($row); Assert::same(1, $row->id); Assert::same(true, $row->flag); Expected result: ---------------- // 5.3.17 Nette\Database\Row(2) { id => 0 flag => "\00" } Nette\Database\Row(2) { id => 1 flag => "\01" } // PHP 5.4.7 Nette\Database\Row(2) { id => 0 flag => "0" } Nette\Database\Row(2) { id => 1 flag => "1" } Actual result: -------------- Both PHP versions the same.