xref: /PHP-8.2/ext/pdo/tests/bug_43663.phpt (revision f768f3d6)
1--TEST--
2PDO Common: Bug #43663 (__call on classes derived from PDO)
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
14class test extends PDO{
15    function __call($name, array $args) {
16        echo "Called $name in ".__CLASS__."\n";
17    }
18    function foo() {
19        echo "Called foo in ".__CLASS__."\n";
20    }
21}
22
23if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/');
24require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
25
26$a = PDOTest::factory(test::class);
27$a->foo();
28$a->bar();
29?>
30--EXPECT--
31Called foo in test
32Called bar in test
33