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