]> granicus.if.org Git - php/commitdiff
add test for alone try block, and update test scripts summary
authorXinchen Hui <laruence@php.net>
Tue, 14 Aug 2012 06:08:38 +0000 (14:08 +0800)
committerXinchen Hui <laruence@php.net>
Tue, 14 Aug 2012 06:08:38 +0000 (14:08 +0800)
Zend/tests/try_catch_finally_002.phpt
Zend/tests/try_catch_finally_003.phpt
Zend/tests/try_catch_finally_004.phpt
Zend/tests/try_finally_004.phpt [new file with mode: 0644]

index 94143f6fd1eca7926c665d23d79f0cdd466f2272..79efcb3de8cc4eb37d3ed37905af3dc49ffc956f 100644 (file)
@@ -1,5 +1,5 @@
 --TEST--
-Try catch finally
+Try catch finally catch(multi catch blocks)
 --FILE--
 <?php
 
index 78b37be1248d2ce35d3dfbff794d2db230f5e31b..e605538c8692f360dd6f1e4aa610b0ae4602b4b6 100644 (file)
@@ -1,5 +1,5 @@
 --TEST--
-Try catch finally
+Try catch finally (multi catch blcoks with return)
 --FILE--
 <?php
 
index c6946012d9c4d90d4689070a712c2c35b8200b13..eb8d0966a1ca2aa4efa6a74f2a5d4edbddddfc68 100644 (file)
@@ -1,5 +1,5 @@
 --TEST--
-Try catch finally
+Try catch finally (re-throw exception in catch block)
 --CREDITS--
 adoy
 --FILE--
diff --git a/Zend/tests/try_finally_004.phpt b/Zend/tests/try_finally_004.phpt
new file mode 100644 (file)
index 0000000..8caa8fb
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+Try without catch/finally block
+--FILE--
+<?php
+function foo () {
+   try {
+        echo "3";
+   }
+}
+
+foo();
+?>
+--EXPECTF--
+Fatal error: Cannot use try without catch or finally in %stry_finally_004.php on line %d