php-src icon indicating copy to clipboard operation
php-src copied to clipboard

Regression in unpack for minimal int value

Open remicollet opened this issue 4 years ago • 0 comments

Description

The following code:

<?php
var_dump($a=-2147483648, bin2hex($b=pack("i",  $a)), unpack("i", $b));

Resulted in this output:

  int(2147483648)

But I expected this output instead:

  int(-2147483648)

See https://3v4l.org/3pTU9 and efe79e0de6944091b585293210667976c23006d7

PHP Version

8.1.2RC1

Operating System

irrevelant

remicollet avatar Jan 07 '22 07:01 remicollet