'thread_safe' => true,
'use_result' => true,
);
+
+ if (version_compare(PHP_VERSION, '5.3.99', '<=')) {
+ $expected_methods['client_encoding'] = true;
+ }
+
if ($IS_MYSQLND) {
// mysqlnd only
/* $expected_methods['get_client_stats'] = true; */
printf("ok\n");
printf("\nClass variables:\n");
- $variables = array_keys(get_class_vars(get_class($mysqli)));
- sort($variables);
- foreach ($variables as $k => $var)
- printf("%s\n", $var);
+
+ $expected_class_variables = $expected_object_variables = array(
+ "affected_rows" => true,
+ "client_info" => true,
+ "client_version" => true,
+ "connect_errno" => true,
+ "connect_error" => true,
+ "errno" => true,
+ "error" => true,
+ "field_count" => true,
+ "host_info" => true,
+ "info" => true,
+ "insert_id" => true,
+ "protocol_version" => true,
+ "server_info" => true,
+ "server_version" => true,
+ "sqlstate" => true,
+ "stat" => true,
+ "thread_id" => true,
+ "warning_count" => true,
+ );
+
+ if (version_compare(PHP_VERSION, '5.3.99', '>')) {
+ $expected_class_variables["error_list"] = true;
+ $expected_object_variables["error_list"] = true;
+ }
+
+ $variables = get_class_vars(get_class($mysqli));
+ foreach ($variables as $var => $v) {
+ if (isset($expected_class_variables[$var])) {
+ unset($expected_class_variables[$var]);
+ unset($variables[$var]);
+ }
+ }
+
+ if (!empty($expected_class_variables)) {
+ printf("Dumping list of missing class variables\n");
+ var_dump($expected_class_variables);
+ }
+ if (!empty($variables)) {
+ printf("Dumping list of unexpected class variables\n");
+ var_dump($variables);
+ }
+ echo "ok\n";
printf("\nObject variables:\n");
- $variables = array_keys(get_object_vars($mysqli));
- foreach ($variables as $k => $var)
- printf("%s\n", $var);
+ $variables = get_object_vars($mysqli);
+ foreach ($variables as $var => $v) {
+ if (isset($expected_object_variables[$var])) {
+ unset($expected_object_variables[$var]);
+ unset($variables[$var]);
+ }
+ }
+
+ if (!empty($expected_object_variables)) {
+ printf("Dumping list of missing object variables\n");
+ var_dump($expected_object_variables);
+ }
+ if (!empty($variables)) {
+ printf("Dumping list of unexpected object variables\n");
+ var_dump($variables);
+ }
+ echo "ok\n";
+
printf("\nMagic, magic properties:\n");
$mysqli->error, gettype($mysqli->error),
mysqli_error($link), gettype(mysqli_error($link)));
- assert(mysqli_error_list($link) === $mysqli->error_list);
- printf("mysqli->error_list = '%s'/%s ('%s'/%s)\n",
- $mysqli->error_list, gettype($mysqli->error_list),
- mysqli_error_list($link), gettype(mysqli_error_list($link)));
+ if (version_compare(PHP_VERSION, '5.3.99', '>')) {
+ assert(mysqli_error_list($link) === $mysqli->error_list);
+ assert(is_array($mysqli->error_list));
+ }
assert(mysqli_field_count($link) === $mysqli->field_count);
printf("mysqli->field_count = '%s'/%s ('%s'/%s)\n",
ok
Class variables:
-affected_rows
-client_info
-client_version
-connect_errno
-connect_error
-errno
-error
-error_list
-field_count
-host_info
-info
-insert_id
-protocol_version
-server_info
-server_version
-sqlstate
-stat
-thread_id
-warning_count
+ok
Object variables:
-affected_rows
-client_info
-client_version
-connect_errno
-connect_error
-errno
-error
-error_list
-field_count
-host_info
-info
-insert_id
-server_info
-server_version
-stat
-sqlstate
-protocol_version
-thread_id
-warning_count
+ok
Magic, magic properties:
mysqli->affected_rows = '%s'/integer ('%s'/integer)
mysqli->client_version = '%d'/integer ('%d'/integer)
mysqli->errno = '0'/integer ('0'/integer)
mysqli->error = ''/%unicode|string% (''/%unicode|string%)
-mysqli->error_list = 'Array'/array ('Array'/array)
mysqli->field_count = '0'/integer ('0'/integer)
mysqli->insert_id = '0'/integer ('0'/integer)
mysqli->sqlstate = '00000'/%unicode|string% ('00000'/%unicode|string%)