diff options
author | Xinchen Hui <laruence@php.net> | 2015-07-03 11:18:53 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-07-03 11:18:53 +0800 |
commit | e8f992c163eff2fc5ebf44d9a39599ed70463253 (patch) | |
tree | 3e0b03bd3db3288ddd1e4bc905544ed64cf82183 /tests | |
parent | 21029da71cb1fe714f28120754bba4d6deceac65 (diff) | |
download | php-git-e8f992c163eff2fc5ebf44d9a39599ed70463253.tar.gz |
Catch the specifical exception
Diffstat (limited to 'tests')
6 files changed, 9 insertions, 9 deletions
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";
}
}
|