com php-src: test timeout with foreach loop: tests/basic/timeou t_variation_8.phpt
| From: | Anatol Belski | Date: | Mon, 16 Mar 2015 18:30:04 +0000 |
| Subject: | com php-src: test timeout with foreach loop: tests/basic/timeou t_variation_8.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85532@lists.php.net to get a copy of this message | ||
Commit: 33d832bd45978ca1f36d9db2d1341683f9ed786c
Author: Anatol Belski <ab@php.net> Mon, 16 Mar 2015 19:30:04 +0100
Parents: b05635ade90b37d5f3a47d7bccadda8db03cdea8
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=33d832bd45978ca1f36d9db2d1341683f9ed786c
Log:
test timeout with foreach loop
Changed paths:
A tests/basic/timeout_variation_8.phpt
Diff:
diff --git a/tests/basic/timeout_variation_8.phpt b/tests/basic/timeout_variation_8..phpt
new file mode 100644
index 0000000..dfb2d2e
--- /dev/null
+++ b/tests/basic/timeout_variation_8.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Timeout within foreach loop
+--FILE--
+<?php
+
+$t = 3;
+set_time_limit($t);
+
+foreach(range(0, 42) as $i) {
+ echo 1;
+ sleep(1);
+}
+
+?>
+never reached here
+--EXPECTF--
+111
+Fatal error: Maximum execution time of 3 seconds exceeded in %s on line %d