#49521 [NEW]: Bug in fetching objects

From: Date: Thu, 10 Sep 2009 11:45:31 +0000
Subject: #49521 [NEW]: Bug in fetching objects
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142217@lists.php.net to get a copy of this message
From:             waps at pisem dot net
Operating system: Ubuntu 8.10 x64
PHP version:      5.2.10
PHP Bug Type:     PDO related
Bug description:  Bug in fetching objects

Description:
------------
Incorrect creating user object: set data before call constructor method.

Reproduce code:
---------------
---
From manual page: pdostatement.fetchobject
---

class Product {
    public function __construct() {
        echo 'create object, ';
    }
    public function __set($offset, $value) {
        echo 'set value, ';
    }
}

// fetch object
$stmt->fetchObject('Product', array());

Expected result:
----------------
Expected result: create object, set value, 

Actual result:
--------------
Actual result: set value, create object,

-- 
Edit bug report at http://bugs.php.net/?id=49521&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=49521&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=49521&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=49521&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=49521&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49521&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=49521&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=49521&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=49521&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=49521&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=49521&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=49521&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=49521&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=49521&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=49521&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49521&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49521&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=49521&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=49521&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=49521&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=49521&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=49521&r=mysqlcfg



Thread (9 messages)

« previous php.bugs (#142217) next »