xref: /PHP-7.2/tests/lang/045.phpt (revision 40b2048f)
1--TEST--
2Timeout again inside register_shutdown_function
3--SKIPIF--
4<?php
5if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6if (PHP_ZTS) die("skip hard_timeout works only on no-zts builds");
7?>
8--INI--
9hard_timeout=1
10--FILE--
11<?php
12set_time_limit(1);
13register_shutdown_function("plop");
14
15function plop() {
16    $ts = time();
17    while(true) {
18        if ((time()-$ts) > 2) {
19            echo "Failed!";
20            break;
21        }
22    }
23}
24plop();
25?>
26===DONE===
27--EXPECTF--
28Fatal error: Maximum execution time of 1 second exceeded in %s on line %d
29
30Fatal error: Maximum execution time of 1 second exceeded in %s on line %d
31