php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46579 % integer overflow - no error message
Submitted: 2008-11-15 16:41 UTC Modified: 2008-11-25 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: grissom dot bulldog at btinternet dot com Assigned:
Status: No Feedback Package: Math related
PHP Version: 5.2.6 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: grissom dot bulldog at btinternet dot com
New email:
PHP Version: OS:

 

 [2008-11-15 16:41 UTC] grissom dot bulldog at btinternet dot com
Description:
------------
To add my 2 cents to the (looks like ongoing) issue of the % operator returning negative values when there is an integer overflow (ie where it is greater than 2^31-1)

I'm not happy with the way the explanation is hand-waved away by previous replies saying "it's not a bug, it's an integer overflow".  

And I am aware there are other functions and ways round the problem, but that does not escape the fact that the function returns an erroneous value to the unsuspecting programmer who has not considered integer overflow.

I would want that in such an instance, instead of returning a negative value and carrying on as if everything were perfectly alright, PHP should return an error message, something like "Integer Overflow at line 100".


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-17 09:50 UTC] jani@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2008-11-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 03 21:01:24 2020 UTC