php.net |  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
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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-22 22:27 UTC] tony2001@php.net
Assigned to myself, I need to test the patch.
 [2005-11-23 13:52 UTC] tony2001@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC