summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEtienne Kneuss <colder@php.net>2009-05-31 21:32:42 +0000
committerEtienne Kneuss <colder@php.net>2009-05-31 21:32:42 +0000
commit61bbd8af7505f9e11cc4f0639d2ae8985a8d9fae (patch)
tree32fe546dd71c485b56ebf59308ee13aef66080bf /tests
parent2d6377e3224d39d3f6af9f324186b2a94444d05c (diff)
downloadphp-git-61bbd8af7505f9e11cc4f0639d2ae8985a8d9fae.tar.gz
MFH: Add test for the timeout inside shutdown function
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/045.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lang/045.phpt b/tests/lang/045.phpt
new file mode 100644
index 0000000000..399fac7f60
--- /dev/null
+++ b/tests/lang/045.phpt
@@ -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