News Feed
Sections




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

Project:
Patchwork-Doc - JSON Formatted Output of PHP variables
October 06, 2011 @ 12:16:58

Nicolas Grekas has submitted about a new tool he's developed to "represent faithfully any PHP variable as complex as it is" - Patchwork-Doc (related to his Patchwork PHP framework).

The JSON format on which it rests guarantees maximum interoperability while ensuring good readability. The implementation done in the JsonDumper class operates all potentialities of the representation while providing maximum latitude to the developer to exploit its ability as desired, both in term of exposure of internal class mechanism for specialization and in terms of custom use, thanks to the callbacks that allow to intercept the JSON line by line and to adjust the dumping of objects or resources according to their type.

It isn't required to use the framework to use this tool, however. You can see an example of the output format in this example on the project's github page, complete with a guide to some of the advantages and disadvantages of some of the current, more common methods of output. Several types are included in the example including simple string/integer values, objects, classes, stream resources and the results of variable casting.

0 comments voice your opinion now!
patchworkdoc output variable json encode framework patchwork


blog comments powered by Disqus

Similar Posts

Chris Hartjes' Blog: Tutorial: Integrating PHP/SWF Charts with CakePHP

Zend Developer Zone: Zend Framework Hidden Gems: Zend Plumbing

PHPMaster.com: Laravel: Is It Really Clean and Classy?

Jani Hartikainen's Blog: Creating a simple abstract model to reduce boilerplate code

Stefan Koopmanschap's Blog: Distributing your project with symfony embedded


Community Events





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


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

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