 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
DZone.com: All debugging and no testing makes the PHP programmer a dull boy
by Chris Cornutt July 10, 2012 @ 13:06:02
In this new post on DZone.com, Giorgio Sironi suggests that "all debugging and no testing" in your development practices can be more difficult in the long run.
By now you have already understood that I would always proposed automated end-to-end and unit tests as a way to substitute much of debugging. End-to-end tests can serve only to discover that a bug exists, while a unit test's job is instead to tell you exactly where the problem is.
He advocates testing because it fits two needs - it's repeatable (a consistent, "third party" structure) and it allows you to find the pieces of code causing the issue more quickly rather than having to guess where the problem is an insert checks. He doesn't suggest completely getting rid of things like Xdebug, though. They have their place and he even suggests some configuration changes that can help make it even more effective.
voice your opinion now!
unittest debug xdebug tool printr vardump
Phil Sturgeon's Blog: Power dump() on your PHP applications
by Chris Cornutt September 30, 2010 @ 11:04:03
Phil Sturgeon has a quick new post with a code snippet that could make your debugging life a bit simpler - a "dump" function that can give you a bit more information about your error than a standard var_dump.
When trying to work out what the hell is going wrong in your PHP application the first thing most of us start doing is madly start var_dump()'ing everything possible to work out where the problem is. var_dump() is fine, but by default it comes out in one line. So then we need to echo <pre> tags. Then we can't always see whats going on, especially if the background is black and bla bla bla so it goes on.
He mentions an alternative like XDebug, but that also requires access to install it on the server. His alternative, the "dump" function, catches the error, pulls out a backtrace of the path your script took to get there and echoes it out with the line number of the error and filename.
voice your opinion now!
debug snippet vardump backtrace
DevShed: Working with the XDebug extension's var_dump() function
by Chris Cornutt February 18, 2009 @ 07:57:55
DevShed has posted the next part in their series looking at using the XDebug extension. This time they focus on the var_dump function and the enhancements the extension brings to the table.
As you may know, "var_dump()" is a PHP native function, but the X-debug library provides an enhanced version of it that's capable of retrieving much more information about a supplied variable. These capabilities greatly extend its usefulness in debugging.
This enhanced version of var_dump displays not only the usual variable information (types, value, etc) but also allows for more advanced output like the object definition, including properties, in their example.
voice your opinion now!
xdebug tutorial extension vardump output enhanced
Zend Developer Zone: Introducing xdebug
by Chris Cornutt December 10, 2007 @ 12:56:00
On the Zend Developer Zone today, Stefan Priebsch has written up an article introducing fellow developers to XDebug, a popular PHP debugging suite.
This article is the first installment of a five-part series of articles covering xdebug, a free and open source swiss army knife tool for PHP developers. xdebug is a PHP extension created by Derick Rethans, one of the PHP core developers. This week, we will show you how to install xdebug and introduce you to some of the basic features. In the subsequent parts of this article series, we will have a closer look at one of xdebug's main features, namely tracing, profiling, debugging, and code coverage.
In this first installment, he looks at installing the software (both on a unix-based system and on a Windows box) and how to turn it on to work with your web server. He also mentions some of the error output options including the "new and improved" var_dump call and the stack trace method to help you locate exactly where in the code the error's hidden.
voice your opinion now!
xdebug debugger introduction install error output trace vardump xdebug debugger introduction install error output trace vardump
Clay Loveless' Blog: PHP and JSON Cut #987
by Chris Cornutt March 01, 2007 @ 08:43:00
In a new post today, Clay Loveless talks about some issues he's been having with PHP and JSON, specifically with the JSON encoding method in PHP 5.2.1.
As of PHP 5.2.1, json_decode() no longer follows the published standards for JSON-encoded texts. Why not? For no reason other than the convenience of those ignorant of JSON standards.
His complaint stems from the results of a vat_dump statement - prior to this version it would give a NULL, but now it returns a "bool(true)" value back, resulting in some breakage of previous scripts. He spends the rest of the post explaining his voyage through the JSON world and how things are supposed to behave. He also digs a little deeper into the var_dump issue and why he thinks it's such a bad thing.
voice your opinion now!
json vardump null true strict adhere extension standard json vardump null true strict adhere extension standard
|
Community Events
Don't see your event here? Let us know!
|