Re: hints and constraints

From: Date: Thu, 05 Feb 2015 14:24:09 +0000
Subject: Re: hints and constraints
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-81930@lists.php.net to get a copy of this message
Christoph Becker wrote on 05/02/2015 14:01:
Rowan Collins wrote:
There is nothing new about PHP's userland int type being 64-bit on 64-bit platforms. For instance, raising 2 to the power of 62 returns exactly the same thing on every version of PHP back to 4.3.0: http://3v4l.org/VBMbv
Unfortunately, that's not true for Windows, see <http://windows.php.net/download/#x64>: | The x64 builds of PHP for Windows should be considered experimental, | and do not yet provide 64-bit integer or large file support. Please | see this post for work ongoing to improve these builds.
Yes, the picture on Windows is rather different, hence my second comment that most production builds of PHP are probably on (64-bit) Linux. The point is that writing code in PHP and assuming integers will overflow after 32 bits has been a bad idea for a long time, outside of really unusual cases like COM integration [1], where there's a valid reason to assume you'll never want to run it on Linux. [1] http://php.net/manual/en/book.com.php Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#81930) next »