Last active
April 7, 2017 13:49
-
-
Save mageekguy/d71e784ef046e0342d52cc5d5b6d8bd2 to your computer and use it in GitHub Desktop.
About PHP_INT_MAX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# php --version | |
PHP 7.0.12 (cli) (built: Nov 3 2016 12:54:26) ( NTS ) | |
Copyright (c) 1997-2016 The PHP Group | |
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies | |
# php -a | |
php > var_dump((PHP_INT_MAX + 1) > PHP_INT_MAX); | |
bool(false) | |
php > var_dump((PHP_INT_MAX + 1) < PHP_INT_MAX); | |
bool(false) | |
php > var_dump((PHP_INT_MAX + 1) == PHP_INT_MAX); | |
bool(true) | |
php > var_dump((PHP_INT_MAX + 1000) == PHP_INT_MAX); | |
bool(true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IIRC there is an old proposal to switch to gmp by default on interger overflow.
BTW, huge performance issue.