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