2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

いつの間にか XAMPP for Windows が 64bit になっていた

Last updated at Posted at 2019-04-27

Linux版とMac版が 64bit 化した後も長らくWindows版だけが 32bit のままでしたが、今年の3月頃からWindows版も 64bit でリリースされるようになりました
(最近は全くXAMPPを使っていなかったので気が付きませんでした)

Download XAMPP

PHPの動作検証

これまでの 32bit PHP

D:\>php --version
PHP 5.5.19 (cli) (built: Nov 12 2014 12:35:44)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

D:\>php -r "echo PHP_INT_MAX;"
2147483647

D:\>php -r "$a=2147483647;var_dump($a);$a++;var_dump($a);$n=(int)$a;var_dump($n);"
int(2147483647)
float(2147483648)
int(-2147483648)

2147483647 を超えた整数を与えたときにオーバーフローしています

64bit PHP

D:\>php --version
PHP 7.2.17 (cli) (built: Apr  2 2019 20:11:25) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

D:\>php -r "echo PHP_INT_MAX;"
9223372036854775807

D:\>php -r "$a=2147483647;var_dump($a);$a++;var_dump($a);$n=(int)$a;var_dump($n);"
int(2147483647)
int(2147483648)
int(2147483648)

2147483647 を超えた整数でもオーバーフローしていません

参考

PHPでintをオーバーフローさせた結果 - Qiita

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?