Bug #51757 [Opn]: Division By Zero triggers Warning instead of Fatal Error
| From: | sstratton@php.net | Date: | Thu, 06 May 2010 14:23:42 +0000 |
| Subject: | Bug #51757 [Opn]: Division By Zero triggers Warning instead of Fatal Error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150229@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51757&edit=1
ID: 51757
User updated by: sstratton@php.net
Reported by: sstratton@php.net
-Summary: Division By Zero in Soap Service Returns 0
+Summary: Division By Zero triggers Warning instead of Fatal
Error
Status: Open
Type: Bug
Package: Math related
Operating System: Linux
PHP Version: 5.3.2
New Comment:
Changed title to reflect scope of the bug.
Previous Comments:
------------------------------------------------------------------------
[2010-05-06 16:14:09] sstratton@php.net
Description:
------------
In PHP 5.3 (and probably 5.2x as well) a division by Zero returns null
and
squelches a warning. The issue becomes when the return is cast to Int
as is done
via soap service which is where I discovered this issue.
Test script:
---------------
<?PHP
$val = 5/0;
echo (int)$val;
Expected result:
----------------
Fatal Error: Division by zero in /var/www/reproduction/test.php on line
3
Actual result:
--------------
Warning: Division by zero in /var/www/reproduction/test.php on line 3
int(0)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51757&edit=1