Xdebug 2.3: Moar var_dump()
This is the first article in a series about the new features in Xdebug 2.3, which was first released on February 22nd.
One of the new features relates to one of the first things that I added in the original Xdebug: making the var_dump() output "pretty". Xdebug replaces PHP's standard var_dump() function with its own version, as long as the xdebug.overload_var_dump setting is not set to 0.
Which means that instead of:
array(4) { [0]=> int(42) [1]=> string(6) "string" [2]=> bool(true) [3]=> float(3.1415926535898) }
You get:
Nothing new so far.
Xdebug 2.3 enhances the overloading of var_dump() with the inclusion of the file name and line number where var_dump() is called at. This has been a long standing feature request.
You can include this information, by setting xdebug.overload_var_dump to 2. If the xdebug.overload_var_dump setting is set to 2, the overloaded var_dump() output now looks like:
As you can see, the file name and line number of where var_dump() were called are prepended to the output.
An already existing setting, xdebug.file_link_format, allows you to format file name and line number information so that Xdebug generates a link. This same setting is also respected by the inclusion of the file name and line number in the enhanced var_dump() output. Setting xdebug.file_link_format to xdebug://%f:%l will then link the file name to xdebug:///home/httpd/html/test/xdebug/overload-var-dump.php:4. If we look at this as an image, we will see:
In a future version of Xdebug, it is likely that I will either wrap in the file name/line number information in the overloaded var_dump(), or change the default value of the setting to 2.
Other parts in this series:
Life Line
Magpie About to Do What Magpies Do
While observing cormorants stretching out, I noticed this cheeky birb on a branch admiring the same stretching out.
#photography #Birds #BirdPhotography #BirdsOfFediverse #NaturePhotography #wildlife #wwt #london
Specify whether kerbs have tactile paving
Determine the heights of kerbs
Survey hairdresser's customers
Specify bridge structures
Specify maximum allowed weights
Specify whether there are cycleways
Specify cycleways width
Specify whether public transport stops have benches
Specify whether public transport stops have shelters
Specify step counts
Survey tactile paving on steps
Specify path surfaces
Specify bicycle parking types
Specify bicycle parkings covers
Specify camera types
Survey if places still exist
Add whether public transport stops are lit
Determine place names
Survey opening hours
Survey housenumbers
Specify power poles material type
Determine information board names
Specify board types
Specify whether traffic signals have sound signals


Shortlink
This article has a short URL available: https://drck.me/vardump23-bnb