xref: /PHP-8.2/ext/pdo_sqlite/tests/bug_47769.phpt (revision 584dc19d)
1--TEST--
2PDO Common: Bug #47769 (Strange extends PDO)
3--EXTENSIONS--
4pdo_sqlite
5--FILE--
6<?php
7
8class test extends PDO
9{
10    protected function isProtected() {
11        echo "this is a protected method.\n";
12    }
13    private function isPrivate() {
14        echo "this is a private method.\n";
15    }
16
17    public function quote($str, $paramtype = NULL): string|false {
18        $this->isProtected();
19        $this->isPrivate();
20        print $str ."\n";
21
22        return $str;
23    }
24}
25
26$test = new test('sqlite::memory:');
27$test->quote('foo');
28$test->isProtected();
29
30?>
31--EXPECTF--
32this is a protected method.
33this is a private method.
34foo
35
36Fatal error: Uncaught Error: Call to protected method test::isProtected() from global scope in %s:%d
37Stack trace:
38#0 {main}
39  thrown in %s on line %d
40