xref: /PHP-8.1/ext/pdo/tests/bug_77849.phpt (revision 74859783)
1--TEST--
2PDO Common: Bug #77849 (Unexpected segfault attempting to use cloned PDO object)
3--EXTENSIONS--
4pdo
5--SKIPIF--
6<?php
7$dir = getenv('REDIR_TEST_DIR');
8if (false == $dir) die('skip no driver');
9require_once $dir . 'pdo_test.inc';
10PDOTest::skip();
11?>
12--FILE--
13<?php
14if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
15require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
16
17$db = PDOTest::factory();
18$db2 = clone $db;
19?>
20--EXPECTF--
21Fatal error: Uncaught Error: Trying to clone an uncloneable object of class PDO in %s
22Stack trace:
23#0 {main}
24  thrown in %s on line %d
25