com php-src: test timeout with array_walk: tests/basic/ti meout_variation_2.phpt
| From: | Anatol Belski | Date: | Mon, 16 Mar 2015 18:05:21 +0000 |
| Subject: | com php-src: test timeout with array_walk: tests/basic/ti meout_variation_2.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85540@lists.php.net to get a copy of this message | ||
Commit: 82d3a13983a64f1ef7d6c7f7e017b7f25d827a83
Author: Anatol Belski <ab@php.net> Mon, 16 Mar 2015 19:05:21 +0100
Parents: f591c0dff884190f23ed122668684978a7b13c1f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=82d3a13983a64f1ef7d6c7f7e017b7f25d827a83
Log:
test timeout with array_walk
Changed paths:
A tests/basic/timeout_variation_2.phpt
Diff:
diff --git a/tests/basic/timeout_variation_2.phpt b/tests/basic/timeout_variation_2.phpt
new file mode 100644
index 0000000..b374e9c
--- /dev/null
+++ b/tests/basic/timeout_variation_2.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Timeout within array_walk
+--FILE--
+<?php
+
+$t = 3;
+set_time_limit($t);
+
+function cb(&$i, $k, $p)
+{
+ echo 1;
+ sleep(1);
+}
+
+$a = array(1 => 1, 2 => 1, 3 => 1, 4 => 1, 5 => 1, 6 => 1, 7 => 1);
+array_walk($a, "cb", "junk");
+
+?>
+never reached here
+--EXPECTF--
+111
+Fatal error: Maximum execution time of 3 seconds exceeded in %s on line %d