bug36802.phpt 700 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Bug #36802 (crashes with with mysqli_set_charset())
  3. --SKIPIF--
  4. <?php require_once('skipif.inc'); ?>
  5. --FILE--
  6. <?php
  7. class really_my_mysqli extends mysqli {
  8. function __construct()
  9. {
  10. }
  11. }
  12. require_once("connect.inc");
  13. $mysql = mysqli_init();
  14. /* following operations should not work */
  15. if (method_exists($mysql, 'set_charset')) {
  16. $x[0] = @$mysql->set_charset('utf8');
  17. } else {
  18. $x[0] = NULL;
  19. }
  20. $x[1] = @$mysql->query("SELECT 'foo' FROM DUAL");
  21. /* following operations should work */
  22. $x[2] = ($mysql->client_version > 0);
  23. $x[3] = $mysql->errno;
  24. $mysql->close();
  25. var_dump($x);
  26. ?>
  27. --EXPECT--
  28. array(4) {
  29. [0]=>
  30. NULL
  31. [1]=>
  32. NULL
  33. [2]=>
  34. bool(true)
  35. [3]=>
  36. int(0)
  37. }