php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42874 Feature proposal for print_r (for all PHP versions!)
Submitted: 2007-10-06 09:59 UTC Modified: 2007-10-06 10:10 UTC
From: rc at opelgt dot org Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.4 OS: all
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: rc at opelgt dot org
New email:
PHP Version: OS:

 

 [2007-10-06 09:59 UTC] rc at opelgt dot org
Description:
------------
When using print_r for debugging it would be nice to see the name of 
the array. When the default maybe remains without name an additional 
parameter could say if the name of the array shall be displayed too
(or a new function name print_rv with v for verbose?).

now:
Array
(
    [0] => K02
    [1] => K03
    [2] => K01
    [3] => K04
    [4] => K09
)

proposal:
Array arrayname
(
    [0] => K02
    [1] => K03
    [2] => K01
    [3] => K04
    [4] => K09
)





Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-06 10:10 UTC] johannes@php.net
This is not possible since the variable container doesn't know anything about a name and also might have 0 or multiple names. You can simply print more information when needed.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 30 21:00:03 2025 UTC