|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-05-29 06:16 UTC] sebastian@php.net
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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 08:00:01 2025 UTC |
The value of PHP_INT_MIN (but not of PHP_INT_MAX) is a float apparently. You can use function f(int $i = PHP_INT_MIN) {} as a workaround.