Skip to content

Commit cdacad8

Browse files
committed
Merge branch 'PHP-7.4'
2 parents 08b7279 + 62b053a commit cdacad8

8 files changed

+29
-1
lines changed

tests/basic/timeout_variation_10.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ set_time_limit($t);
1414
function f()
1515
{
1616
echo "call";
17+
$startTime = microtime(true);
1718
busy_wait(5);
19+
$diff = microtime(true) - $startTime;
20+
echo "\ntime spent waiting: $diff\n";
1821
}
1922

2023
register_shutdown_function("f");

tests/basic/timeout_variation_2.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ function cb(&$i, $k, $p)
1616
busy_wait(1);
1717
}
1818

19+
$startTime = microtime(true);
20+
1921
$a = array(1 => 1, 2 => 1, 3 => 1, 4 => 1, 5 => 1, 6 => 1, 7 => 1);
2022
array_walk($a, "cb", "junk");
2123

24+
$diff = microtime(true) - $startTime;
25+
echo "time spent waiting: $diff\n";
2226
?>
2327
never reached here
2428
--EXPECTF--

tests/basic/timeout_variation_3.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ set_time_limit($t);
1313

1414
function hello ($t) {
1515
echo "call", PHP_EOL;
16+
$startTime = microtime(true);
1617
busy_wait($t*2);
18+
$diff = microtime(true) - $startTime;
19+
echo "time spent waiting: $diff\n";
1720
}
1821

1922
eval('hello($t);');

tests/basic/timeout_variation_4.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ set_time_limit($t);
1313

1414
function hello ($t) {
1515
echo "call", PHP_EOL;
16+
$startTime = microtime(true);
1617
busy_wait($t*2);
18+
$diff = microtime(true) - $startTime;
19+
echo "time spent waiting: $diff\n";
1720
}
1821

1922
call_user_func('hello', $t);

tests/basic/timeout_variation_5.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ set_time_limit($t);
1313

1414
function f($t) {
1515
echo "call";
16+
$startTime = microtime(true);
1617
busy_wait($t*2);
17-
throw new Exception("never reached here");
18+
$diff = microtime(true) - $startTime;
19+
throw new Exception("never reached here (time spent waiting: $diff)");
1820
}
1921

2022
f($t);

tests/basic/timeout_variation_7.phpt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ include __DIR__ . DIRECTORY_SEPARATOR . "timeout_config.inc";
1111

1212
set_time_limit($t);
1313

14+
$startTime = microtime(true);
15+
1416
for ($i = 0; $i < 42; $i++) {
1517
busy_wait(1);
1618
}
1719

20+
$diff = microtime(true) - $startTime;
21+
echo "time spent waiting: $diff\n";
22+
1823
?>
1924
never reached here
2025
--EXPECTF--

tests/basic/timeout_variation_8.phpt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ include __DIR__ . DIRECTORY_SEPARATOR . "timeout_config.inc";
1111

1212
set_time_limit($t);
1313

14+
$startTime = microtime(true);
15+
1416
foreach (range(0, 42) as $i) {
1517
busy_wait(1);
1618
}
1719

20+
$diff = microtime(true) - $startTime;
21+
echo "time spent waiting: $diff\n";
22+
1823
?>
1924
never reached here
2025
--EXPECTF--

tests/basic/timeout_variation_9.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ set_time_limit($t);
1414
function f()
1515
{
1616
echo "call";
17+
$startTime = microtime(true);
1718
busy_wait(5);
19+
$diff = microtime(true) - $startTime;
20+
echo "\ntime spent waiting: $diff\n";
1821
}
1922

2023
register_shutdown_function("f");

0 commit comments

Comments
 (0)