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

Derick Rethans:
Xdebug 2.3: Enhanced xdebug_debug_zval()
Mar 03, 2015 @ 16:50:41

Derick Rethans has posted another article about Xdebug and some of the changes made in the most recent release, version 2.3. In his previous post he talked about the improvements to var_dump and in this one he shares updates to the xdebug_debug_zval handling.

xdebug_debug_zval() has been around for quite some time, to provide correct information about how PHP internally stores a variable. Unlike PHP's built in debug_zval_dump() function, it does not modify the variable information that it tries to show. This is because instead of passing in a variable, you pass in its name. Passing a variable into a function, can modify the various parameters that are associated with this variable, such as the is_ref and refcount fields.

He includes a bit of background about what the function is used for and then shows the difference it has in 2.3: the ability to handle nested data structures including property dereference support. He includes a few code examples showing the use of the function and the output it would generate for both an array and an object.

tagged: xdebug enhanced xdebugdebugzval array subarray object dereference

Link: http://derickrethans.nl/xdebug-2.3-xdebug-debug-zval.html

DevShed:
Working with the XDebug extension's var_dump() function
Feb 18, 2009 @ 13: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.

tagged: xdebug tutorial extension vardump output enhanced

Link:


Trending Topics: