10 years of Xdebug and Xdebug 2.2.0 released
Today it has been ten years since the first release of Xdebug: version 0.7.0. I would like to celebrate this tenth anniversary with a new release: Xdebug 2.2.0. Xdebug 2.2 adds support for PHP 5.4 and provides some new features:
Colours on the command line
First of all there is now var_dump() overloading and colours on the command line. I've already written about that before, but here are the screenshots again:
Linux/Mac:
Windows:
You can find an article about this here.
Better support for closures in stack and function traces
Closures are functions that don't have a function name associated with them. Therefore, Xdebug creates a pseudo function in its stack traces. The stack trace for this example:
<?php
function test1()
{
$f = function($a, $b) {
$Q = strlen($a * $b);
trigger_error('foo');
};
$f(5, 25);
}
test1();
?>
Looks like:
Notice: foo in /tmp/closure-stack-trace.php on line 21
Call Stack:
0.0009 268464 1. {main}() /tmp/closure-stack-trace.php:0
0.0026 269288 2. test1() /tmp/closure-stack-trace.php:27
0.0032 270024 3. {closure:/tmp/closure-stack-trace.php:19-22}($a = 5, $b = 25) /tmp/closure-stack-trace.php:24
0.0038 270496 4. trigger_error('foo') /tmp/closure-stack-trace.php:21
In the 3rd line in the call stack you see {closure:/tmp/closure-stack-trace.php:19-22}($a = 5, $b = 25) where /tmp/closure-stack-trace.php:19-22 contains the filename and line numbers on which the closure is defined at.
The size of arrays is now shown with the overloaded variable output
After this change, each array in the HTML version of the overloaded var_dump() function now looks like:
<b>array</b> <i>(size=5)</li>
Before the change, this was only:
<b>array</b>
Added the method call type to xdebug_get_function_stack
This changes adds another array element to xdebug_get_function_stack() to show whether it was a static or dynamic function call. For example, for:
new Error_Entry(false, $errno);
It now adds the ["type"]=> string(7) "dynamic" element to each stack element:
array(6) {
["function"]=>
string(11) "__construct"
["type"]=>
string(7) "dynamic"
["class"]=>
string(11) "Error_Entry"
["file"]=>
string(%d) "%sbug00241.php"
["line"]=>
int(11)
Extra information to error printouts to tell that the error suppression operator has been ignored due to xdebug.scream
When you have the xdebug.scream option activated, Xdebug will now tell you when it had any effect on the error reporting with a big "SCREAM: Error suppression ignored for" warning prepended to the actual error message.
Changelog
You can find the full changelog for Xdebug 2.2.0 at the Xdebug website where you can also download the latest version. If you are using Windows, and don't know which binary to download, please refer to the wizard.
Support
If you find Xdebug valuable for your PHP development, perhaps you want to support its development by acquiring a "support" contract. See the buying "support" page if you feel generous.
What's next?
Now Xdebug 2.2 is out of the door, I am looking for new features to add to Xdebug. What would you like to see added to Xdebug? Please leave a comment here, or add your feature requests at http://bugs.xdebug.org.
Comments
I am still hoping that we will find the time to implement what we outlined in http://sebastian-bergmann.de/archives/913-Towards-Better-Code-Coverage-Metrics-in-the-PHP-World.html ;-)
Congratulations on ten years of Xdebug!
Congrats on the 10 years! This is a heckuva tool you developed and I use it every day to debug my code.
Still shipping with .cvsignore ;-) Thank you for the hard work and h'ppy birthday Xdebug.
Life Line
I think this was my favourite photo of the set that I took. It's not at maximum coverage, but it does have a sun spot group (4508) just on the cusp of the terminator.
#eclipse #eclipse2026 #SolarEclipse #London #Astronomy #AstroPhotography #Photography
No totality here in London, but still had a great evening out in the local park and taking some snaps.
I did have a nice Solar Filter that I made for my lens, and had many conversations with people from different backgrounds. Kids loves to look through my filter after I was done (ran out of battery power).
More photos later...
I walked 0.9km in 9m28s
I walked 1.2km in 19m05s
Merged pull request #1100
Fixed issue #2267: Application slow when debugger is not listening on…
I walked 4.7km in 48m18s
I walked 3.0km in 1h10m24s
Is there somebody who runs PHP on native windows (with Xdebug) and can run a simple script for me?
It must be in a file (`test.php`):
```
<?php
echo microtime(true), "\n";
xdebug_connect_to_client();
echo microtime(true), "\n";
```And run like:
php -dxdebug.log_level=11 -dxdebug.log=c:\temp\xdebug-i.log -dxdebug.client_host=localhost -dxdebug.client_port=9111 -dxdebug.mode=debug c:\temp\test.php
With the port 9111 not open.
Would love to see the output and log file (in a DM).
I walked 5.5km in 55m06s
@harry_wood This is this list of 100 Go-mistakes that I was talking about: https://100go.co/
Updated a crossing
I walked 2.1km in 20m08s
Enjoying my afternoon and evening out at Lords for some cricket!
I walked 3.2km in 38m54s
I walked 9.1km in 1h34m28s
Updated a gate
Updated a bakery shop
Updated a convenience shop
I walked 8.1km in 1h32m18s
I walked 5.6km in 59m13s
Updated a restaurant and a cafe; Confirmed 2 restaurants and a cafe
I walked 6.7km in 1h8m27s
I walked 4.7km in 50m02s
I got myself a sheet of Sun-safe filter material, and McGuyvered a pop-up filter for my lens.
The first attempt sort of worked, but I didn't get the filter 100% straight. Luckily I have more material.
But this is sort of my first attempt, and a few sunspots are clearly visible on the right of the image.
Warning: Never look at the Sun without protection!





Shortlink
This article has a short URL available: https://drck.me/xdebug-10-9eo