Bug #76385 [NEW]: Value of PHP_INT_MIN cannot be used as default value for int parameter
| From: | sebastian@php.net | Date: | Tue, 29 May 2018 06:16:26 +0000 |
| Subject: | Bug #76385 [NEW]: Value of PHP_INT_MIN cannot be used as default value for int parameter | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-215400@lists.php.net to get a copy of this message | ||
From: sebastian
Operating system: Irrelevant
PHP version: 7.2.6
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Value of PHP_INT_MIN cannot be used as default value for int parameter
Description:
------------
$ cat a.php
<?php
var_dump(PHP_INT_MIN);
$ cat b.php
<?php
function f(int $i = -9223372036854775808)
{
}
$ php -nv
PHP 7.2.6 (cli) (built: May 22 2018 16:22:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
$ php -n a.php
int(-9223372036854775808)
$ php -n b.php
Fatal error: Default value for parameters with a integer type can only
be integer or NULL in /home/sb/b.php on line 2
--
Edit bug report at https://bugs.php.net/bug.php?id=76385&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76385&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76385&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76385&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76385&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76385&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76385&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76385&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76385&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76385&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76385&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76385&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76385&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76385&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76385&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76385&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76385&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76385&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76385&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76385&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76385&r=mysqlcfg