php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70116 debug_zval_dump print int as "long"
Submitted: 2015-07-23 03:08 UTC Modified: 2015-08-20 01:22 UTC
From: laruence@php.net Assigned: kalle (profile)
Status: Closed Package: *General Issues
PHP Version: 7.0.0beta1 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: laruence@php.net
New email:
PHP Version: OS:

 

 [2015-07-23 03:08 UTC] laruence@php.net
Description:
------------
for:
<?php
debug_zval_dump(1);
var_dump(1);
?>

debug_zval_dump prints long(1), 

bug var_dump prints int(1)

maybe they should print the same for consistent?

Test script:
---------------
<?php
debug_zval_dump(1);
var_dump(1);
?>

Expected result:
----------------
long(1)
long(1)

or 

int(1)
int(1)

Actual result:
--------------
long(1)
int(1)

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-23 03:27 UTC] yohgaki@php.net
+1 for consistency.
"int" is preferred because PHP shouldn't care size of integer. One day, we may have arbitrarily size of integer.
 [2015-07-23 11:04 UTC] bwoebi@php.net
I'm not sure. debug_zval_dump() should show whether it is a long or a bigint, whenever we introduce them… Such internal differences is exactly what this function is good for.
 [2015-07-23 21:27 UTC] ab@php.net
There's no long usage anymore, it's abstracted to int64_t or int32_t which can be whatever, fe long long. That has no relation to the internal happening anymore. But int (and/or bigint later) sounds consistent with the user land.

Thanks.
 [2015-08-20 01:22 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 16:01:35 2024 UTC