Skip to content

Feature request: display string lengths in var dumper #15856

@Alorel

Description

@Alorel

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