bug28817.phpt 862 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Bug #28817 (problems with properties declared in the class extending MySQLi)
  3. --EXTENSIONS--
  4. mysqli
  5. --SKIPIF--
  6. <?php
  7. require_once('skipifconnectfailure.inc');
  8. ?>
  9. --FILE--
  10. <?php
  11. require_once("connect.inc");
  12. class my_mysql extends mysqli {
  13. public $p_test;
  14. function __construct() {
  15. $this->p_test[] = "foo";
  16. $this->p_test[] = "bar";
  17. }
  18. }
  19. $mysql = new my_mysql();
  20. var_dump($mysql->p_test);
  21. try {
  22. $mysql->errno;
  23. } catch (Error $exception) {
  24. echo $exception->getMessage() . "\n";
  25. }
  26. $mysql->connect($host, $user, $passwd, $db, $port, $socket);
  27. $mysql->select_db("nonexistingdb");
  28. var_dump($mysql->errno > 0);
  29. $mysql->close();
  30. ?>
  31. --EXPECTF--
  32. array(2) {
  33. [0]=>
  34. %s(3) "foo"
  35. [1]=>
  36. %s(3) "bar"
  37. }
  38. my_mysql object is already closed
  39. bool(true)