Revision 19792,
516 bytes
checked in by Seasoft, 13 years ago
(diff) |
#744(PHP4 互換用途ソースを将来的に切り捨てやすい仕組みづくり)
|
Line | |
---|
1 | --TEST-- |
---|
2 | Function -- time_sleep_until |
---|
3 | --SKIPIF-- |
---|
4 | <?php if (function_exists('time_sleep_until')) { echo 'skip'; } ?> |
---|
5 | --FILE-- |
---|
6 | <?php |
---|
7 | require_once 'PHP/Compat.php'; |
---|
8 | PHP_Compat::loadFunction('time_sleep_until'); |
---|
9 | |
---|
10 | function ehandler($no, $str) |
---|
11 | { |
---|
12 | echo '(Warning) '; |
---|
13 | } |
---|
14 | set_error_handler('ehandler'); |
---|
15 | |
---|
16 | $time = time(); |
---|
17 | time_sleep_until($time + 3); |
---|
18 | echo '3:', time() - $time; |
---|
19 | |
---|
20 | echo PHP_EOL; |
---|
21 | |
---|
22 | $time = time(); |
---|
23 | time_sleep_until($time - 1); |
---|
24 | echo '-1:', time() - $time; |
---|
25 | |
---|
26 | restore_error_handler(); |
---|
27 | ?> |
---|
28 | --EXPECT-- |
---|
29 | 3:3 |
---|
30 | (Warning) -1:0 |
---|
Note: See
TracBrowser
for help on using the repository browser.