News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Derick Rethans:
Contributing Advent 1 Xdebug and hidden properties
December 02, 2013 @ 09:16:50

As a part of his "Advent Contribution" series Derick Rethans has posted about an update to XDebug that fixes a bug reported around hidden properties.

This first contribution is for bug #987: "Hidden property names not shown". In PHP it is possible to convert an array to an object. [...] Xdebug's standard HTML var_dump() as well as the CLI, the coloured CLI and the debugger interface DBGp all suffered from the same issues that numerical properties were not showing in output.

With the committed fix the output of the var_dump now shows these special property names with curly braces around them and makes them available via the property_get method. If you're interested in the actual commit, you can check it out here.

0 comments voice your opinion now!
advent contribute hidden properties xdebug vardump propertyget

Link: http://derickrethans.nl/advent01.html

Sameer Borate:
Easy PHP debugging with Kint
November 07, 2013 @ 11:24:02

Sameer Borate has posted about using Kint, a "more powerful debugger" that lets you output more data than just the usual var_dump or print_r provides and in a much more readable format.

My standard debugging tool when using PHP is xdebug. Pairing xdebug with Komodo gives me a very productive environment for building PHP applications. However, testing an application code on a hosted server can be many times frustrating as one has only the print_r and var_dump functions at our disposal. What I need is a library that I can easily install on the server and start using. Although there are a few debugging libraries around, one of my favorites is Kint.

He walks you through the installation of the tool and provides an example of the most basic usage (and output) from a call to the tool's "dump" function. He also gets into some of the additional features the library provides including intelligent formatting, debug tracing and limited theme configuration.

0 comments voice your opinion now!
debug kint output printr vardump example setup

Link: http://www.codediesel.com/tools/easy-php-debugging-with-kint/

DZone.com:
All debugging and no testing makes the PHP programmer a dull boy
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.

0 comments voice your opinion now!
unittest debug xdebug tool printr vardump


Phil Sturgeon's Blog:
Power dump() on your PHP applications
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.

1 comment voice your opinion now!
debug snippet vardump backtrace


Matthew Turland's Blog:
CDC Update (or an Unusual Parse Error)
April 09, 2009 @ 09:32:46

Matthew Turland came across an interesting bug when working with the Cares Document Checker he's developing related to linting (running a syntax check) on a given PHP file.

While doing a lint check on a code block, a parse error was occurring on a line that contained a comment in the original source file. [...] Presumably what was happening was, even though the var_dump() call showed that actual newlines were being interpreted correctly, the r was also being interpreted rather than taken literally. This caused the comma following it to generate the error I was receiving.

An alternative to the method he was using, shell_exec, is proc_open, a function that opens a resource to handle a command execution and allows for more than just the "point and shoot" execution that things like shell_exec, or system.

0 comments voice your opinion now!
parse error vardump comment shellexec system exec procopen


DevShed:
Working with the XDebug extension's var_dump() function
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.

0 comments voice your opinion now!
xdebug tutorial extension vardump output enhanced


Brandon Savage's Blog:
Bug-Free Your Bug-Fixing Toolkit (Part 1 of N)
October 16, 2008 @ 10:29:57

Brandon Savage has the first part of a series posted (with N parts) showing off some of the tools that PHP already has built in to make your debugging life easier.

PHP has a large number of tools for fixing bugs and resolving underlying issues. But many people don't know what they are, and some of them are extensions requiring installation in order to work. In this series, we'll explore some features for debugging PHP scripts, from the most basic to more advanced.

He looks at three of the most basic ones (and ones that most developers I know out there use every day) - var_dump, print_r and var_export. Examples of each in use are included...

0 comments voice your opinion now!
debug tool included vardump printr varexport tutorial


Vinu Thomas' Blog:
Replace print_r and var_dump with Krumo
April 09, 2008 @ 14:44:31

Vinu Thomas has proposed a replacement for the usual var_dump or print_r sort of debugging developers tend to do - Krumo.

To put it simply, Krumo is a replacement for print_r() and var_dump(). By definition Krumo is a debugging tool (now for PHP5 only), which displays structured information about any PHP variable [...] it does the same job, but it presents the information beautified using CSS and DHTML.

It also supports output of other data in a "pretty format" like backtraces, included files and a listing of all constants. You can check out a demo of it in action here.

0 comments voice your opinion now!
krumo printf vardump replace sourceforge css html pretty


Zend Developer Zone:
Introducing xdebug
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.

0 comments voice your opinion now!
xdebug debugger introduction install error output trace vardump xdebug debugger introduction install error output trace vardump


Sara Golemon's Blog:
Fun with unicode
July 30, 2007 @ 08:45:00

Sara Golemon, being interested in Unicode as she is, decided to investigate further when she saw a recent post about issues with Unicode math symbols:

Being a whimsical sort, I decided that actually implementing his request would be more fun than simply pish-poshing it. I'm not suggesting this be part of PHP6 (I still don't personally think it's a good idea), but it's a fun exercise and good for a conversation starter...

There's several things she can now do with the special characters including dumping out the results of divisions, comparisons and fractions natively.

0 comments voice your opinion now!
unicode vardump math symbols programming patch php6 unicode vardump math symbols programming patch php6



Community Events





Don't see your event here?
Let us know!


security opinion laravel list artisanfiles series introduction interview voicesoftheelephpant community library conference version tool symfony framework composer podcast release language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework