1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Files
archived-php-src/ext/pdo/tests/pdo_uninitialized.phpt
T
2020-10-19 10:22:56 +02:00

40 lines
728 B
PHP

--TEST--
Uninitialized PDO objects
--SKIPIF--
<?php if (!extension_loaded('pdo')) die('skip'); ?>
--FILE--
<?php
class MyPDO extends PDO {
public function __construct() {}
}
class MyPDOStatement extends PDOStatement {
public function __construct() {}
}
$pdo = new MyPDO;
try {
$pdo->query("foo");
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
$stmt = new MyPDOStatement;
try {
$stmt->fetch();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
$stmt = new MyPDOStatement;
try {
foreach ($stmt as $row) {}
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
PDO object is not initialized, constructor was not called
PDO object is uninitialized
PDO object is uninitialized