|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35336 crash on PDO::FETCH_CLASS + __set()
Submitted: 2005-11-22 18:15 UTC Modified: 2005-11-23 13:52 UTC
From: stochnagara at hotmail dot com Assigned: tony2001 (profile)
Status: Closed Package: PDO related
PHP Version: 5CVS-2005-11-22 (snap) OS: windows xp
Private report: No CVE-ID: None
 [2005-11-22 18:15 UTC] stochnagara at hotmail dot com
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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-22 22:27 UTC]
Assigned to myself, I need to test the patch.
 [2005-11-23 13:52 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 20 14:03:56 2023 UTC