Skip to content

[VarDumper] Strings consisting of just spaces are trimmed #57980

@olva-borsen

Description

@olva-borsen

Symfony version(s) affected

6.4

Description

VarDumper::dump(' '); shows an empty string with nothing in it.

VarDumper::dump(' '); also shows as an empty string.

I experienced this trying to debug a larger object, where one of the values was a string with a single space in it. But the method showed it as an empty string, thus confusing my debugging.

How to reproduce

Run the following:

<?php
use Symfony\Component\VarDumper\VarDumper;
VarDumper::dump(' ');

This should show up as an empty string.

Possible Solution

No response

Additional Context

No response

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