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
Stonechat on a Branch
This lovely male Stonechat perched up quite nicely for me on a branch at Staines Moor.
#photography #Birds #BirdPhotography #BirdsOfFediverse #NaturePhotography #wildlife
Merge branch 'v2022'
Update data to 2026f
Updated a building
Specify cycleways width
Survey if vacant places are still vacant
Specify whether places take fees to visit
Specify maximum allowed weights
Specify whether pedestrian crossings have islands
Specify whether kerbs have tactile paving
Determine the heights of kerbs
Specify street/place names to addresses
Survey housenumbers
Specify whether there are crossings at intersections of paths and roads
Specify whether traffic signals have sound signals
Specify whether traffic signals have tactile indications that it's safe to cross
Specify whether public transport stops have tactile paving
Specify whether public transport stops have bins
Specify path surfaces
Specify postbox royal cyphers
Survey postbox collection times
Specify maximum heights
Survey hairdresser's customers
Survey opening hours
Specify whether roads have lane markings


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