xref: /PHP-5.3/ext/pdo_sqlite/tests/bug35336.phpt (revision c92ae847)
1--TEST--
2Bug #35336 (crash on PDO::FETCH_CLASS + __set())
3--SKIPIF--
4<?php # vim:ft=php
5if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
6?>
7--FILE--
8<?php
9class EEE {
10	function __set ($field, $value) {
11		echo "hello world\n";
12	}
13}
14
15$a = new PDO("sqlite::memory:");// pool ("sqlite::memory:");
16$a->query ("CREATE TABLE test (a integer primary key, b text)");
17$b = $a->prepare("insert into test (b) values (?)");
18$b->execute(array (5));
19$rez = $a->query ("SELECT * FROM test")->fetchAll(PDO::FETCH_CLASS, 'EEE');
20
21echo "Done\n";
22?>
23--EXPECTF--
24hello world
25hello world
26Done
27