Req #10657 [Opn->Csd]: Add warning about overflow to settype()
| From: | kalle@php.net | Date: | Sun, 23 Jul 2017 02:12:17 +0000 |
| Subject: | Req #10657 [Opn->Csd]: Add warning about overflow to settype() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210214@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=10657&edit=1
ID: 10657
Updated by: kalle@php.net
Reported by: tf at tfromm dot com
Summary: Add warning about overflow to settype()
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: Variables related
Operating System: linux
PHP Version: 7.1.1
-Assigned To:
+Assigned To: kalle
Block user comment: N
Private report: N
New Comment:
I agree that there should not be any warnings, if anything this should go through the RFC process
instead of the bug tracker
Previous Comments:
------------------------------------------------------------------------
[2017-03-14 03:48:39] spam2 at rhsoft dot net
NO there SHOUL DNOT be added warnings - how do you imagine to handle warnings triggered by
<?=(int)$_GET['bla']?> when it exceeds PHP_INT_MAX? there are people which running
E_ALL in production and warnings which can be properly fixed except add again @ with all it's
dirt and overhead are not helpful
------------------------------------------------------------------------
[2017-03-14 03:25:32] pollita@php.net
@nikic I disagree. It seems like warnings *should* be added for these overflow on cast cases.
It's not BC, but the existing behavior could hardly be described as "working as reasonably
expected".
------------------------------------------------------------------------
[2017-01-20 17:43:54] nikic@php.net
settype() behaves the same as an (int) cast. I highly doubt that we'd add such a warning for
(int) casting.
------------------------------------------------------------------------
[2017-01-20 17:30:39] requinix@php.net
settype is not issuing warnings.
https://3v4l.org/LSBfU - numeric string >PHP_INT_MAX to int
https://3v4l.org/LT5dX - non-numeric string to int
------------------------------------------------------------------------
[2017-01-20 17:05:31] heiglandreas@php.net
Is this still relevant?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=10657
--
Edit this bug report at https://bugs.php.net/bug.php?id=10657&edit=1