Symfony News

New in Symfony 2.7: VarDumper improvements

The VarDumper component was introduced in Symfony 2.6 to provide a better debugging experience. This component includes a dump() function which is a much better alternative to the regular PHP var_dump() function.

In Symfony 2.7 we made the dump() function easier to use and we also improved the dumping of complex variables such as PHP reflection classes.

Added support for recursive node toggling

Contributed by
Nicolas Grekas and Lars Wallenborn in #14071.

In Symfony 2.6, when dumping a deeply nested variable, you must click on each node arrow to reveal the contents of the nested nodes:

Symfony 2.7 removes this hassle by adding recursive toggle support. Just press the Ctrl key before clicking on any arrow and you'll toggle all the nested nodes:

Added new specialized casters

Contributed by
Nicolas Grekas and Grégoire Pineau in #14080, #13980, #14034, and #13960.

The VarDumper component uses casters to transform the objects and resources into the array-based data representation used to display the variable contents. Symfony 2.7 includes new casters to improve the debugging of Reflection classes, MongoCursor objects, XML parser resources and AMQP resources.

For example, when you dump a PHP class reflection in Symfony 2.6, you get the string representation of that reflection:

Reflection in Symfony 2.6

In Symfony 2.7, thanks to the new specialized caster for PHP reflection classes, you'll see a much better dump:

Reflection in Symfony 2.7

Be trained by Symfony experts - 2015-04-27 Cologne - 2015-04-27 Cologne - 2015-04-29 Cologne

About us

What a Symfony developer should know about the framework: News, Jobs, Tweets, Events, Videos,...

Find us on Twitter

Find us on Facebook