mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.1' into PHP-8.2
This commit is contained in:
commit
038bbd2d2f
1 changed files with 9 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue