com php-src: Catch the specifical exception: Zend/tests/bug69957.phpt Zend/tests/compound_assign_with_numeric_strings.phpt Zend/tests/mod_001.phpt
tests/lang/operators/bit wiseShiftLeft_basiclong_64bit.phpt tests/lang/opera tors/bitwiseShiftLeft_variationStr_64bit.phpt tests
/lang/operators/bitwiseShiftRight_basiclong_64bit.php t tests/lang/operators/bitwiseShiftRight_variationStr.php t
tests/lang/operators/modulus_basiclong_64bit.phpt tests/lang/oper
| From: | Xinchen Hui | Date: | Fri, 03 Jul 2015 03:18:53 +0000 |
| Subject: | com php-src: Catch the specifical exception: Zend/tests/bug69957.phpt Zend/tests/compound_assign_with_numeric_strings.phpt Zend/tests/mod_001.phpt tests/lang/operators/bit wiseShiftLeft_basiclong_64bit.phpt tests/lang/opera tors/bitwiseShiftLeft_variationStr_64bit.phpt tests /lang/operators/bitwiseShiftRight_basiclong_64bit.php t tests/lang/operators/bitwiseShiftRight_variationStr.php t tests/lang/operators/modulus_basiclong_64bit.phpt tests/lang/oper |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87719@lists.php.net to get a copy of this message | ||
Commit: e8f992c163eff2fc5ebf44d9a39599ed70463253
Author: Xinchen Hui <laruence@php.net> Fri, 3 Jul 2015 11:18:53 +0800
Parents: 21029da71cb1fe714f28120754bba4d6deceac65
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e8f992c163eff2fc5ebf44d9a39599ed70463253
Log:
Catch the specifical exception
Changed paths:
M Zend/tests/bug69957.phpt
M Zend/tests/compound_assign_with_numeric_strings.phpt
M Zend/tests/mod_001.phpt
M tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt
M tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
M tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt
M tests/lang/operators/bitwiseShiftRight_variationStr.phpt
M tests/lang/operators/modulus_basiclong_64bit..phpt
M tests/lang/operators/modulus_variationStr.phpt
Diff:
diff --git a/Zend/tests/bug69957.phpt b/Zend/tests/bug69957.phpt
index 5aa0eda..d8d3a6f 100644
--- a/Zend/tests/bug69957.phpt
+++ b/Zend/tests/bug69957.phpt
@@ -7,7 +7,7 @@ try {
$divisor = 0;
$result = 1 / $divisor;
var_dump($result);
-} catch (Throwable $t){
+} catch (DivisionByZeroError $t){
echo "Variable div\n";
printf("Type: %s\n", get_class($t));
printf("Message: %s\n", $t->getMessage());
@@ -17,7 +17,7 @@ try {
$divisor = 0;
$result = 1 % $divisor;
var_dump($result);
-} catch (Throwable $t){
+} catch (DivisionByZeroError $t){
echo "\nVariable mod\n";
printf("Type: %s\n", get_class($t));
printf("Message: %s\n", $t->getMessage());
@@ -26,7 +26,7 @@ try {
try {
$result = 1 / 0;
var_dump($result);
-} catch (Throwable $t){
+} catch (DivisionByZeroError $t){
echo "\nLiteral div\n";
printf("Type: %s\n", get_class($t));
printf("Message: %s\n", $t->getMessage());
@@ -35,7 +35,7 @@ try {
try {
$result = 1 % 0;
var_dump($result);
-} catch (Throwable $t){
+} catch (DivisionByZeroError $t){
echo "\nLiteral mod\n";
printf("Type: %s\n", get_class($t));
printf("Message: %s\n", $t->getMessage());
@@ -44,7 +44,7 @@ try {
try {
$result = 1 / 0.0;
var_dump($result);
-} catch (Throwable $t){
+} catch (DivisionByZeroError $t){
echo "\nDouble div\n";
printf("Type: %s\n", get_class($t));
printf("Message: %s\n", $t->getMessage());
@@ -53,7 +53,7 @@ try {
try {
$result = 1 % 0.0;
var_dump($result);
-} catch (Throwable $t){
+} catch (DivisionByZeroError $t){
echo "\nDouble mod\n";
printf("Type: %s\n", get_class($t));
printf("Message: %s\n", $t->getMessage());
diff --git a/Zend/tests/compound_assign_with_numeric_strings.phpt
b/Zend/tests/compound_assign_with_numeric_strings.phpt
index fbfc160..72c80b0 100644
--- a/Zend/tests/compound_assign_with_numeric_strings.phpt
+++ b/Zend/tests/compound_assign_with_numeric_strings.phpt
@@ -11,7 +11,7 @@ $n = "-1";
try {
$n <<= $n;
var_dump($n);
-} catch (Throwable $e) {
+} catch (ArithmeticError $e) {
echo "\nException: " . $e->getMessage() . "\n";
}
@@ -23,7 +23,7 @@ $n = "-1";
try {
$n >>= $n;
var_dump($n);
-} catch (Throwable $e) {
+} catch (ArithmeticError $e) {
echo "\nException: " . $e->getMessage() . "\n";
}
@@ -31,7 +31,7 @@ $n = "0";
try{
$n %= $n;
var_dump($n);
-} catch (Throwable $e) {
+} catch (DivisionByZeroError $e) {
echo "\nException: " . $e->getMessage() . "\n";
}
diff --git a/Zend/tests/mod_001.phpt b/Zend/tests/mod_001.phpt
index ff589e2..2c1ebc7 100644
--- a/Zend/tests/mod_001.phpt
+++ b/Zend/tests/mod_001.phpt
@@ -9,7 +9,7 @@ $b = array();
try {
$c = $a % $b;
var_dump($c);
-} catch (Throwable $e) {
+} catch (DivisionByZeroError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
diff --git a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt
b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt
index 380beca..99626da 100644
--- a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt
+++ b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt
@@ -27,7 +27,7 @@ foreach ($longVals as $longVal) {
echo "--- testing: $longVal << $otherVal ---\n";
try {
var_dump($longVal<<$otherVal);
- } catch (Throwable $e) {
+ } catch (ArithmeticError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
@@ -38,7 +38,7 @@ foreach ($otherVals as $otherVal) {
echo "--- testing: $otherVal << $longVal ---\n";
try {
var_dump($otherVal<<$longVal);
- } catch (Throwable $e) {
+ } catch (ArithmeticError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
index 174d947...d5888d8 100644
--- a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
+++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
@@ -19,7 +19,7 @@ foreach ($strVals as $strVal) {
echo "--- testing: '$strVal' << '$otherVal' ---\n";
try {
var_dump($strVal<<$otherVal);
- } catch (Throwable $e) {
+ } catch (ArithmeticError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
diff --git a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt
b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt
index c85c440...65e7e82 100644
--- a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt
+++ b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt
@@ -27,7 +27,7 @@ foreach ($longVals as $longVal) {
echo "--- testing: $longVal >> $otherVal ---\n";
try {
var_dump($longVal>>$otherVal);
- } catch (Throwable $e) {
+ } catch (ArithmeticError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
@@ -38,7 +38,7 @@ foreach ($otherVals as $otherVal) {
echo "--- testing: $otherVal >> $longVal ---\n";
try {
var_dump($otherVal>>$longVal);
- } catch (Throwable $e) {
+ } catch (ArithmeticError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
index 1c3277a..a86d0cf 100644
--- a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
+++ b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
@@ -15,7 +15,7 @@ foreach ($strVals as $strVal) {
echo "--- testing: '$strVal' >> '$otherVal' ---\n";
try {
var_dump($strVal>>$otherVal);
- } catch (Throwable $e) {
+ } catch (ArithmeticError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
diff --git a/tests/lang/operators/modulus_basiclong_64bit.phpt
b/tests/lang/operators/modulus_basiclong_64bit.phpt
index c2db77c..6806bd5 100644
--- a/tests/lang/operators/modulus_basiclong_64bit.phpt
+++ b/tests/lang/operators/modulus_basiclong_64bit.phpt
@@ -27,7 +27,7 @@ foreach ($longVals as $longVal) {
echo "--- testing: $longVal % $otherVal ---\n";
try {
var_dump($longVal%$otherVal);
- } catch (Throwable $e) {
+ } catch (DivisionByZeroError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
@@ -38,7 +38,7 @@ foreach ($otherVals as $otherVal) {
echo "--- testing: $otherVal % $longVal ---\n";
try {
var_dump($otherVal%$longVal);
- } catch (Throwable $e) {
+ } catch (DivisionByZeroError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
diff --git a/tests/lang/operators/modulus_variationStr.phpt
b/tests/lang/operators/modulus_variationStr.phpt
index 4948700..c647ecd 100644
--- a/tests/lang/operators/modulus_variationStr.phpt
+++ b/tests/lang/operators/modulus_variationStr.phpt
@@ -15,7 +15,7 @@ foreach ($strVals as $strVal) {
echo "--- testing: '$strVal' % '$otherVal' ---\n";
try {
var_dump($strVal%$otherVal);
- } catch (Throwable $e) {
+ } catch (DivisionByZeroError $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}