From: Ulf Wendel Date: Mon, 21 Sep 2009 08:59:00 +0000 (+0000) Subject: Fixing test: references has to be collected even if the users disables the collection... X-Git-Tag: php-5.4.0alpha1~191^2~2636 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d202cd84ddbc8cb25951f888edc0743cf91edb7;p=php Fixing test: references has to be collected even if the users disables the collection of statistics. It is needed for memory management. --- diff --git a/ext/mysqli/tests/mysqli_get_cache_stats_off.phpt b/ext/mysqli/tests/mysqli_get_cache_stats_off.phpt index 8f9fcc7f2d..4b0bab2406 100644 --- a/ext/mysqli/tests/mysqli_get_cache_stats_off.phpt +++ b/ext/mysqli/tests/mysqli_get_cache_stats_off.phpt @@ -33,10 +33,15 @@ if (!function_exists('mysqli_get_cache_stats')) { ; $after = mysqli_get_cache_stats(); - if ($before !== $after) { - printf("[004] Statistics have changed\n"); - var_dump($before); - var_dump($after); + /* references has to be maintained - it is used for memory management */ + $ignore = array('references' => true); + foreach ($before as $k => $v) { + if (isset($ignore[$k])) + continue; + + if ($before[$k] != $after[$k]) + printf("[004] Statistics have changed - %s: %s => %s\n", $ + $k, $before[$k], $after[$k]); } $ignore = array("size" => true, "free_items" => true, "references" => true);