News Feed
Jobs Feed
Sections




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

SitePoint PHP Blog:
How to Expose PHP's Private Parts
November 11, 2008 @ 09:32:14

On the SitePoint PHP Blog Troels Knak-Nielsen has worked up a way to "expose PHP's private parts" when it comes to finding out more about the object/variable he's working with (without a usual print_r or var_dump).

I've been tinkering with dumping PHP objects, and have found myself constantly running into a brick wall. The output from print_r and friends is fine in some contexts, but for larger structures, it would be nice to tidy the output up a bit and wrap it in some HTML.

His solution is to serialize the object into a string (keeping all related meta information) that can be passed around and parsed back into its original form for debugging. He's included the script that works bye taking in the string and manually parsing it back out into its parts into a useful array.

0 comments voice your opinion now!
expose output debug serialize object private protected tutorial


blog comments powered by Disqus

Similar Posts

IBM developerWorks: Devise Web 2.0 applications with PHP and DHTML (Part 1)

NETTUTS.com: Build an RSS 2.0 Feed with CodeIgniter

Abhinav Singh's Blog: How to use locks in PHP cron jobs to avoid cron overlaps

NETTUTS.com: Creating a Dynamic Poll with jQuery and PHP

PHPit.net: Handling dates and times in PHP & MySQL


Community Events











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


application unittest code opinion facebook performance composer framework release podcast install symfony2 language hhvm hack package security component introduction series

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