#42881 [Ver->Csd]: PDO::FETCH_CLASS incorrectly returns PDO::FETCH_BOTH
ID: 42881 User updated by: voidalan at koitech dot net Reported By: voidalan at koitech dot net -Status: Verified +Status: Closed Bug Type: PDO related Operating System: CentOS 5 PHP Version: 5.2.4 New Comment: Duplicate(http://bugs.php.net/43139). Fixed in 5.2.5 Previous Comments: [2007-10-12 18:19:59] [EMAIL PROTECTED] The problem seems to be related to the usage of PDO::FETCH_PROPS_LATE and I can reproduce it with PHP 5.3. Seems to work with HEAD, however. [2007-10-07 07:10:46] voidalan at koitech dot net Description: When using PDO::FETCH_CLASS it incorrectly returns PDO::FETCH_BOTH. In other words instead of returning objects it is returning a mixed array. The below code worked in 5.2.3 but when upgrading to 5.2.4 this occured. Reproduce code: --- http://pastemonkey.org/paste/470883a5-8d1c-4256-a59d-27b2404fdb0d Expected result: Array( [0] => Object( id => hidden => featured => title => clientName => teaser => content => imgUrl => publishedBy => dateCreated => dateModified => ) ... ) Actual result: -- Array ( [0] => Array ( [id] => [0] => [hidden] => [1] => [featured] => [2] => [title] => [3] => [clientName] => [4] => [teaser] => [5] => [content] => [6] => [imgUrl] => [7] => [publishedBy] => [8] => [dateCreated] => [9] => [dateModified] => [10] => ) ... ) -- Edit this bug report at http://bugs.php.net/?id=42881&edit=1
#42881 [NEW]: PDO::FETCH_CLASS incorrectly returns PDO::FETCH_BOTH
From: voidalan at koitech dot net Operating system: CentOS 5 PHP version: 5.2.4 PHP Bug Type: PDO related Bug description: PDO::FETCH_CLASS incorrectly returns PDO::FETCH_BOTH Description: When using PDO::FETCH_CLASS it incorrectly returns PDO::FETCH_BOTH. In other words instead of returning objects it is returning a mixed array. The below code worked in 5.2.3 but when upgrading to 5.2.4 this occured. Reproduce code: --- http://pastemonkey.org/paste/470883a5-8d1c-4256-a59d-27b2404fdb0d Expected result: Array( [0] => Object( id => hidden => featured => title => clientName => teaser => content => imgUrl => publishedBy => dateCreated => dateModified => ) ... ) Actual result: -- Array ( [0] => Array ( [id] => [0] => [hidden] => [1] => [featured] => [2] => [title] => [3] => [clientName] => [4] => [teaser] => [5] => [content] => [6] => [imgUrl] => [7] => [publishedBy] => [8] => [dateCreated] => [9] => [dateModified] => [10] => ) ... ) -- Edit bug report at http://bugs.php.net/?id=42881&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42881&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42881&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42881&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42881&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42881&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42881&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=42881&r=needscript Try newer version:http://bugs.php.net/fix.php?id=42881&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42881&r=support Expected behavior:http://bugs.php.net/fix.php?id=42881&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42881&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42881&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42881&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42881&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42881&r=dst IIS Stability:http://bugs.php.net/fix.php?id=42881&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42881&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42881&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42881&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=42881&r=mysqlcfg