bug_47769.phpt 785 B

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