summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-03-16 19:30:04 +0100
committerAnatol Belski <ab@php.net>2015-03-16 19:30:04 +0100
commit33d832bd45978ca1f36d9db2d1341683f9ed786c (patch)
tree5a27a9eeacc7a6ebb83f113554e1104dbffa02e4 /tests
parentb05635ade90b37d5f3a47d7bccadda8db03cdea8 (diff)
downloadphp-git-33d832bd45978ca1f36d9db2d1341683f9ed786c.tar.gz
test timeout with foreach loop
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/timeout_variation_8.phpt18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/basic/timeout_variation_8.phpt b/tests/basic/timeout_variation_8.phpt
new file mode 100644
index 0000000000..dfb2d2e69e
--- /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