Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Feature request: display string lengths in var dumper #15856

Copy link
Copy link
Closed
@Alorel

Description

@Alorel
Issue body actions

Hey folks. I've just started using the var dumper and it seems to lack a rather useful feature: displaying string lengths.

How it currently works

If one of the variables passed to the dumper is a string, it will be dumped as "string-contents"

$var = ['foo'];
VarDumper::dump($var);
>>>
array:1 [
   0 => & "foo"
]

Proposed change

Display the string length in a manner similar to how array lengths are displayed:

$var = ['foo'];
VarDumper::dump($var);
>>>
array:1 [
   0 => & string:3 "foo"
]

A working example can be found in Raveren's Kint project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.