summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-07-03 11:18:53 +0800
committerXinchen Hui <laruence@php.net>2015-07-03 11:18:53 +0800
commite8f992c163eff2fc5ebf44d9a39599ed70463253 (patch)
tree3e0b03bd3db3288ddd1e4bc905544ed64cf82183
parent21029da71cb1fe714f28120754bba4d6deceac65 (diff)
downloadphp-git-e8f992c163eff2fc5ebf44d9a39599ed70463253.tar.gz
Catch the specifical exception
-rw-r--r--Zend/tests/bug69957.phpt12
-rw-r--r--Zend/tests/compound_assign_with_numeric_strings.phpt6
-rw-r--r--Zend/tests/mod_001.phpt2
-rw-r--r--tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt4
-rw-r--r--tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt2
-rw-r--r--tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt4
-rw-r--r--tests/lang/operators/bitwiseShiftRight_variationStr.phpt2
-rw-r--r--tests/lang/operators/modulus_basiclong_64bit.phpt4
-rw-r--r--tests/lang/operators/modulus_variationStr.phpt2
9 files changed, 19 insertions, 19 deletions
diff --git a/Zend/tests/bug69957.phpt b/Zend/tests/bug69957.phpt
index 5aa0edab21..d8d3a6f1fc 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 fbfc1605ec..72c80b0afc 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 ff589e2fee..2c1ebc7cc2 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 380beca219..99626da6f1 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 174d947445..d5888d837f 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 c85c440312..65e7e826b8 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 1c3277acc8..a86d0cfddb 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 c2db77c120..6806bd53a8 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 49487000b3..c647ecd380 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";
}
}