mysqli_bind_result($stmt, $c1, $c2);
mysqli_fetch($stmt);
mysqli_stmt_close($stmt);
- if (ini_get("unicode.semantics") && mysqli_get_server_version($link) < 50000) {
+ if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && mysqli_get_server_version($link) < 50000) {
/* variables are binary */
settype($c1, "unicode");
settype($c2, "unicode");
$host, $user, $db, $port, $socket);
}
- if (!ini_get("unicode.semantics")) {
+ if (!(version_compare(PHP_VERSION, '5.9.9', '>') == 1)) {
mysqli_query($link, "set names utf8");
}
mysqli_get_client_stats_assert_eq('result_set_queries', $new_info, $info, $test_counter);
/* we need to skip this test in unicode - we send set names utf8 during mysql_connect */
- if (!ini_get("unicode.semantics"))
+ if (!(version_compare(PHP_VERSION, '5.9.9', '>') == 1))
mysqli_get_client_stats_assert_eq('non_result_set_queries', $new_info, $info, $test_counter);
mysqli_get_client_stats_assert_eq('buffered_sets', $new_info, $info, $test_counter);
mysqli_get_client_stats_assert_eq('unbuffered_sets', $new_info, $info, $test_counter);
$warning = new mysqli_warning($mysqli);
$i = 1;
while ($warning->next() && ('' != ($tmp = $warning->message))) {
- if (ini_get('unicode.semantics') && !is_unicode($tmp))
+ if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($tmp))
printf("[033a] Warning should have been a unicode string, got %s/%s", gettype($tmp), $tmp);
$i++;
}
/*
Trying to test what Ramil suggests in http://bugs.mysql.com/bug.php?id=29576
However, this won't work, because we're lacking MYSQLI_SET_CHARSET_NAME.
- if (ini_get("unicode.semantics")) {
+ if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) {
if (mysqli_get_server_version() > 50002) {
@mysqli_query($link, "DROP USER IF EXISTS 'тест'@'%'");
if (TRUE !== mysqli_query($link, "CREATE USER 'тест'@'%'")) {
printf("Callback: %d\n", $invocation++);
- $num_chars = (ini_get('unicode.semantics')) ? (floor($buflen / 2) - 10) : ($buflen - 5);
+ $num_chars = (version_compare(PHP_VERSION, '5.9.9', '>') == 1) ? (floor($buflen / 2) - 10) : ($buflen - 5);
$part1 = floor($num_chars / 2);
$part2 = $num_chars - $part1;