diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-04-06 14:30:05 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-04-06 14:30:05 +0300 |
commit | cae0147ed3ceb55fcb1bc059b8e8ea6a36ea69a8 (patch) | |
tree | 4ca16379ac8d5cab749f07747e2599ee23a4d175 /ext/standard/tests/math | |
parent | caf9219dea58dcc6ef6da2b3b86a1e9808363bff (diff) | |
download | php-git-cae0147ed3ceb55fcb1bc059b8e8ea6a36ea69a8.tar.gz |
Fixed weird operators behavior. Division by zero now emits warning and returns +/-INF, modulo by zero and intdid() throws an exception, shifts by negative offset throw exceptions. Compile-time evaluation of division by zero is disabled.
Diffstat (limited to 'ext/standard/tests/math')
-rw-r--r-- | ext/standard/tests/math/intdiv.phpt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/standard/tests/math/intdiv.phpt b/ext/standard/tests/math/intdiv.phpt index d37d2e8004..cff8469445 100644 --- a/ext/standard/tests/math/intdiv.phpt +++ b/ext/standard/tests/math/intdiv.phpt @@ -9,7 +9,11 @@ var_dump(intdiv(-3, -2)); var_dump(intdiv(PHP_INT_MAX, PHP_INT_MAX)); var_dump(intdiv(-PHP_INT_MAX - 1, -PHP_INT_MAX - 1)); var_dump(intdiv(-PHP_INT_MAX - 1, -1)); -var_dump(intdiv(1, 0)); +try { + var_dump(intdiv(1, 0)); +} catch (Exception $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} ?> --EXPECTF-- @@ -21,5 +25,4 @@ int(1) int(1) int(0) -Warning: intdiv(): Division by zero in %s on line 9 -bool(false) +Exception: Division by zero |