]> granicus.if.org Git - php/commitdiff
Add test for the timeout inside shutdown function
authorEtienne Kneuss <colder@php.net>
Sun, 31 May 2009 21:32:20 +0000 (21:32 +0000)
committerEtienne Kneuss <colder@php.net>
Sun, 31 May 2009 21:32:20 +0000 (21:32 +0000)
tests/lang/045.phpt [new file with mode: 0644]

diff --git a/tests/lang/045.phpt b/tests/lang/045.phpt
new file mode 100644 (file)
index 0000000..399fac7
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+Timeout again inside register_shutdown_function
+--FILE--
+<?php
+set_time_limit(1);
+register_shutdown_function("plop");
+
+function plop() {
+    $ts = time();
+    while(true) {
+        if ((time()-$ts) > 2) {
+            echo "Failed!";
+            break;
+        }
+    }
+}
+plop();
+?>
+===DONE===
+--EXPECTF--
+Fatal error: Maximum execution time of 1 second exceeded in %s on line %d
+
+Fatal error: Maximum execution time of 1 second exceeded in %s on line %d