php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72272 var_dump() incorrect PHP_INT_MAX/MIN info with xdebug.overload_var_dump enabled
Submitted: 2016-05-27 04:27 UTC Modified: 2018-07-13 16:11 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: denixport at gmail dot com Assigned: derick (profile)
Status: Duplicate Package: Xdebug
PHP Version: 7.0.7 OS: Windows 10 64bit
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: denixport at gmail dot com
New email:
PHP Version: OS:

 

 [2016-05-27 04:27 UTC] denixport at gmail dot com
Description:
------------
var_dump() doesn't show correct info about PHP_INT_MAX and PHP_INT_MIN constants on 64bit Windows

Test script:
---------------
<?php

echo PHP_INT_MAX, PHP_EOL;
echo PHP_INT_MIN, PHP_EOL;

var_dump(PHP_INT_MAX);
var_dump(PHP_INT_MIN);

Expected result:
----------------
9223372036854775807
-9223372036854775808
int(9223372036854775807)
int(-9223372036854775808)

Actual result:
--------------
9223372036854775807
-9223372036854775808
int(-1)
int(0)

Patches

main_PHPMAX.patch (last revision 2016-05-27 16:12 UTC by harsha dot patankar at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-27 16:14 UTC] harsha dot patankar at gmail dot com
It was a missing header issue. Now fixed.
 [2016-05-27 19:27 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2016-05-27 19:27 UTC] ab@php.net
Thanks for the report. Though, I cannot reproduce the behavior you describe? Do you compile with vc14 (lower are not supported for 7.0)? Please note also, that stdint.h shouldn't be included directly, see main/php_stdint.h.

Thanks.
 [2016-05-27 20:27 UTC] denixport at gmail dot com
-Status: Feedback +Status: Open
 [2016-05-27 20:27 UTC] denixport at gmail dot com
I'm using this build: VC14 x64 Non Thread Safe 
see details below

$ php -i
phpinfo()
PHP Version => 7.0.7

System => Windows NT DENIX-PC 10.0 build 10586 (Windows 10) AMD64
Build Date => May 25 2016 12:48:10
Compiler => MSVC14 (Visual C++ 2015)
Architecture => x64
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--with-pdo-oci=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shar
ed" "--with-oci8-12c=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer"
 "--with-pgo"
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => C:\WINDOWS
Loaded Configuration File => C:\PHP\php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20151012
PHP Extension => 20151012
Zend Extension => 320151012
Zend Extension Build => API320151012,NTS,VC14
PHP Extension Build => API20151012,NTS,VC14
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled
 [2016-05-29 15:46 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2016-05-29 15:46 UTC] ab@php.net
Thanks for the info. Is that the same config you use for the custom build? Does it repro with -n?

Thanks.
 [2016-05-29 20:04 UTC] denixport at gmail dot com
-Summary: var_dump() incorrect PHP_INT_MAX/MIN info +Summary: var_dump() incorrect PHP_INT_MAX/MIN info with xdebug.overload_var_dump enabled -Status: Feedback +Status: Open -Package: Unknown/Other Function +Package: Xdebug
 [2016-05-29 20:04 UTC] denixport at gmail dot com
you're correct, -n solves the issue, so it's about configuration

I figured out it's xdebug zend extension and it's default ini setting
xdebug.overload_var_dump = 2
 [2016-05-30 05:29 UTC] krakjoe@php.net
-Assigned To: +Assigned To: derick
 [2016-08-19 13:17 UTC] sendthomasanemail at gmail dot com
It looks like it isn't just incorrect info about the constants.

$large_number = 2147483648;
var_dump($large_number);              // int -2147483648

$large_number = 2147483648;
var_dump($large_number);              // -2147483648

$large_number = 9223372036854775807;
var_dump($large_number);              // int -1

$large_number = 9223372036854775808;
var_dump($large_number);              // float 9.2233720368548E+18
 [2018-07-13 16:11 UTC] cmb@php.net
-Status: Assigned +Status: Duplicate
 [2018-07-13 16:11 UTC] cmb@php.net
Duplicate of <https://bugs.xdebug.org/view.php?id=1282>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 28 20:01:28 2024 UTC