--TEST-- mysql_query() --SKIPIF-- --FILE-- ') == 1) && !is_unicode($tmp['p_version'])) { printf("[010] Expecting unicode string, dumping\n"); var_dump($tmp); } mysql_free_result($res); } else { printf("[011] [%d] %s\n", mysql_errno($link), mysql_error($link)); } mysql_query('DROP FUNCTION IF EXISTS f', $link); if (mysql_query('CREATE FUNCTION f( ver_param VARCHAR(25)) RETURNS VARCHAR(25) DETERMINISTIC RETURN ver_param;', $link)) { $res = mysql_query('SELECT f(VERSION()) AS f_version', $link); $tmp = mysql_fetch_assoc($res); if (!isset($tmp['f_version']) || ('' == $tmp['f_version'])) { printf("[012] Result seems wrong, dumping\n"); var_dump($tmp); } if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($tmp['f_version'])) { printf("[013] Expecting unicode string, dumping\n"); var_dump($tmp); } mysql_free_result($res); } else { printf("[014] [%d] %s\n", mysql_errno($link), mysql_error($link)); } } mysql_close($link); if (false !== ($tmp = mysql_query("SELECT id FROM test", $link))) printf("[011] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); print "done!"; ?> --CLEAN-- --EXPECTF-- 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 array(1) { [%u|b%"valid"]=> %unicode|string%(30) "this is sql but with semicolon" } array(1) { [%u|b%""]=> %unicode|string%(1) "a" } %unicode|string%(1) "a" Warning: mysql_query(): %d is not a valid MySQL-Link resource in %s on line %d done!