xref: /PHP-7.2/ext/pdo/tests/pdo_036.phpt (revision 5af586be)
1--TEST--
2Testing PDORow and PDOStatement instances with Reflection
3--SKIPIF--
4<?php if (!extension_loaded('pdo')) die('skip'); ?>
5--FILE--
6<?php
7
8$instance = new reflectionclass('pdostatement');
9$x = $instance->newInstance();
10var_dump($x);
11
12$instance = new reflectionclass('pdorow');
13$x = $instance->newInstance();
14var_dump($x);
15
16?>
17--EXPECTF--
18object(PDOStatement)#%d (1) {
19  ["queryString"]=>
20  NULL
21}
22
23Fatal error: Uncaught PDOException: You may not create a PDORow manually in %spdo_036.php:8
24Stack trace:
25#0 %spdo_036.php(8): ReflectionClass->newInstance()
26#1 {main}
27  thrown in %spdo_036.php on line 8
28