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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

Pull requests:

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: Sat Dec 21 18:01:29 2024 UTC