On Fri, Mar 5, 2021 at 4:56 PM Nikita Popov <nikita....@gmail.com> wrote:

> On Fri, Mar 5, 2021 at 1:36 PM Christian Schneider <cschn...@cschneid.com>
> wrote:
>
> > There is a PR fixing both the indentation and removing the trailing
> > spaces: https://github.com/php/php-src/pull/6724
> >
> > Do you think this needs an RFC?
> >
>
> Well ... making stylistic changes to var_export() has come up a few times
> in the past -- by far the most common request is to use [] instead of
> array(). I think if we're going to make changes here, we should at least
> include that one as well, to make sure all changes happen at the same time.
>
> I'm personally happy with modifying the var_export() output, but from past
> discussions, I got the impression that not everyone else feels that such
> cosmetic changes are justified.
>

On the other hand, the extra space in indentation for objects (vs arrays)
seems an outright bug in implementation, and the trailing space (after
double-arrow before newline) is a common source of problems when editing
.phpt files; whereas changing array() to [] would "just" make the output
shorter (and "more modern") while breaking more tests...

While at it, there are two more things that bug me:
  - the space before the opening parenthesis in "array (", vs
"::__set_state(array(" / "(object) array("
  - the line break after "=>" when the value is an array or object (which
is also the cause of the trailing space, by the way)
but changing them would be a bigger break, too...

Regards,

-- 
Guilliam Xavier

Reply via email to