mysql_get_server_info.phpt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. mysql_get_server_info()
  3. --SKIPIF--
  4. <?php
  5. require_once('skipif.inc');
  6. require_once('skipifconnectfailure.inc');
  7. ?>
  8. --FILE--
  9. <?php
  10. include "connect.inc";
  11. if (null !== ($tmp = @mysql_get_server_info(NULL)))
  12. printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
  13. require "table.inc";
  14. if (!is_string($info = mysql_get_server_info($link)) || ('' === $info))
  15. printf("[003] Expecting string/any_non_empty, got %s/%s\n", gettype($info), $info);
  16. $def_info = mysql_get_server_info();
  17. if ($def_info !== $info) {
  18. printf("[004] Server info for the default link and the specified link differ, [%d] %s\n",
  19. mysql_errno(), mysql_error());
  20. var_dump($def_info);
  21. var_dump($info);
  22. }
  23. if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($info)) {
  24. printf("[005] Expecting Unicode error message!\n");
  25. var_inspect($info);
  26. }
  27. if (NULL !== ($tmp = @mysql_get_server_info('too many', 'just too many')))
  28. printf("[006] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
  29. print "done!";
  30. ?>
  31. --EXPECTF--
  32. Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d
  33. done!