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

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