com php-src: Add test script for #57 (segfaults in drupal7): tests/issue0057.phpt
| From: | Dmitry Stogov | Date: | Thu, 07 Mar 2013 04:19:30 +0000 |
| Subject: | com php-src: Add test script for #57 (segfaults in drupal7): tests/issue0057.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71477@lists.php.net to get a copy of this message | ||
Commit: bc926f2fbb260f220a1e19bd4f17d71c9be7a344
Author: Xinchen Hui <laruence@gmail.com> Thu, 7 Mar 2013 12:19:30 +0800
Parents: b54351134314737374721a3f5d1d043a86f067aa
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bc926f2fbb260f220a1e19bd4f17d71c9be7a344
Log:
Add test script for #57 (segfaults in drupal7)
Bugs:
https://bugs.php.net/57
Changed paths:
A tests/issue0057.phpt
Diff:
diff --git a/tests/issue0057.phpt b/tests/issue0057.phpt
new file mode 100644
index 0000000..1ef3cbb
--- /dev/null
+++ b/tests/issue0057.phpt
@@ -0,0 +1,38 @@
+--TEST--
+ISSUE #57 (segfaults in drupal7)
+--INI--
+zend_optimizerplus.enable=1
+zend_optimizerplus.enable_cli=1
+zend_optimizerplus.optimization_level=-1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+class ZException extends Exception {
+}
+
+function dummy($query) {
+ try {
+ switch ($query) {
+ case 1;
+ break;
+ case 2;
+ break;
+ default:
+ throw new Exception('exception');
+ }
+ } catch (ZException $e) {
+ return NULL;
+ }
+}
+
+try {
+ dummy(0);
+} catch (Exception $e) {
+ echo $e->getMessage();
+}
+
+?>
+--EXPECT--
+exception