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
Updated a bird_hide
Updated a bench
This is not an accessible site. Needs more updates too
This is not an accessible site. Needs more updates too
Created 2 gates
This is indeed no more a clothes shop, but a restaurant
Created 2 waste_baskets, 2 boards, and 2 benches; Updated 8 benches, 6 waste_baskets, and 2 other objects; Deleted 2 waste_baskets and a bench
Updated a pub
Merge branch 'v2022'
Merge branch 'php_gh_19803' into v2022
Fix PHP GH-19803: Parsing a string with a single white space does cre…
Merge branch 'xdebug_3_5'
Back to -dev
Go with 3.5.1
Thanks Brussels, you've been lovely to me this weekend.
And I've a lot to process from the conference too.
I walked 3.9km in 36m24s
I walked 1.1km in 11m31s
Updated a restaurant; Confirmed 3 fast_foods, a convenience shop, and 2 other objects
I walked 4.4km in 44m06s
I walked 5.1km in 56m16s
I walked 3.8km in 37m43s
I'm up early to get the Eurostar to #FOSDEM and I've already seen friends being made.
Fixed another address
Fixed address for flats
Fixed address, and ass missing service way


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