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

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