#35336 [Asn->Csd]: crash on PDO::FETCH_CLASS + __set()
| From: | tony2001@php.net | Date: | Wed, 23 Nov 2005 12:52:11 +0000 |
| Subject: | #35336 [Asn->Csd]: crash on PDO::FETCH_CLASS + __set() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-88779@lists.php.net to get a copy of this message | ||
ID: 35336
Updated by: tony2001@php.net
Reported By: stochnagara at hotmail dot com
-Status: Assigned
+Status: Closed
Bug Type: PDO related
Operating System: windows xp
PHP Version: 5CVS-2005-11-22 (snap)
Assigned To: tony2001
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-11-22 22:27:37] tony2001@php.net
Assigned to myself, I need to test the patch.
------------------------------------------------------------------------
[2005-11-22 18:15:22] stochnagara at hotmail dot com
Description:
------------
I use PDO::FETCH_CLASS mode for fetching DB data with PDO. But when I
implement __set method in my data class, Apache crashes.
Reproduce code:
---------------
<?
class EEE {
function __set ($field, $value) {
echo 'hello world';
}
}
$a = new PDO("sqlite::memory:");// pool ("sqlite::memory:");
$a->query ("CREATE TABLE test (a integer primary key, b text)");
$b = $a->prepare("insert into test (b) values (?)");
$b->execute(array (5));
$rez = $a->query ("SELECT * FROM test")->fetchAll(PDO::FETCH_CLASS,
'EEE');
Expected result:
----------------
$rez contains 1 object of class EEE
Actual result:
--------------
Apache crashes.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35336&edit=1