]> granicus.if.org Git - php/commitdiff
test timeout within function
authorAnatol Belski <ab@php.net>
Mon, 16 Mar 2015 18:01:23 +0000 (19:01 +0100)
committerAnatol Belski <ab@php.net>
Mon, 16 Mar 2015 18:01:23 +0000 (19:01 +0100)
tests/basic/timeout_variation_1.phpt [new file with mode: 0644]

diff --git a/tests/basic/timeout_variation_1.phpt b/tests/basic/timeout_variation_1.phpt
new file mode 100644 (file)
index 0000000..63c641d
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+Timeout within function
+--FILE--
+<?php
+
+$t = 3;
+set_time_limit($t);
+
+function hello ($t) { 
+       echo "call"; 
+       sleep($t*2);
+}
+
+hello($t);
+
+
+?>
+never reached here
+--EXPECTF--
+call
+Fatal error: Maximum execution time of 3 seconds exceeded in %s on line %d