Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in unpack for minimal int value #7899

Closed
remicollet opened this issue Jan 7, 2022 · 0 comments
Closed

Regression in unpack for minimal int value #7899

remicollet opened this issue Jan 7, 2022 · 0 comments

Comments

@remicollet
Copy link
Contributor

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 efe79e0

PHP Version

8.1.2RC1

Operating System

irrevelant

remicollet added a commit that referenced this issue Jan 13, 2022
* PHP-8.1:
  fix GH-7899 Regression in unpack for negative int value
  Fix ext/zend_test/tests/observer_bug81430_2.phpt failure
  JIT: Fix incorrect flag check
remicollet added a commit that referenced this issue Jan 13, 2022
* PHP-8.1:
  fix GH-7899 Regression in unpack for negative int value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@remicollet @cmb69 and others