1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Merge branch 'PHP-8.2'

This commit is contained in:
Jakub Zelenka
2023-08-28 12:18:21 +01:00

View File

@@ -590,6 +590,8 @@ $all_stat_keys = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
"rdev", "size", "atime", "mtime", "ctime",
"blksize", "blocks");
$stat_time_diff_keys = array(8, 'atime');
function compare_stats($stat1, $stat2, $fields, $op = "==", $flag = false ) {
// dump the stat if requested
if ( $flag == true ) {
@@ -606,8 +608,13 @@ function compare_stats($stat1, $stat2, $fields, $op = "==", $flag = false ) {
{
case "==":
if ( $stat1[ $fields[$index] ] != $stat2[ $fields[$index] ] ) {
$result = false;
echo "Error: stat1 do not match with stat2 at key value: $fields[$index]\n";
if ( ! in_array( $index, $stat_time_diff_keys ) ) {
$result = false;
echo "Error: stat1 do not match with stat2 at key value: $fields[$index]\n";
} elseif (abs($stat1[ $fields[$index] ] - $stat2[ $fields[$index] ]) > 1) {
$result = false;
echo "Error: stat1 differs too much from stat2 at key value: $fields[$index]\n";
}
}
break;