cfdump in php!

by Josh Highland on April 24, 2007

At work, I write ColdFusion, at home I write PHP. I bounce back and forth between worlds. Jack of all trades, master of none I guess.

One thing that I have always loved about ColdFusion is the cfdump tag. You feed it any variable, and it will spit out whats in it. Struct, String, Array, Query, Object, XML, it doesnt matter, it just works. I would go as far to say that its one of the best native debugging resources I have ever seen in a web development language.

In PHP, you can do a print_r() and look at the source, but that is no where as cool as cfdump. I have longed for a cfdump style resource to be available in PHP. Today I got my wish when I stumbled upon “dBug”. http://dbug.ospinto.com

dBug is a small PHP class that duplicates the cfdump tag from ColdFusion

look how simple it is to use:

include_once("dBug.php");
new dBug($myVariable);

The output looks like this:
phpdump cfdump in php!

dBug will handle anything you throw at it, just like cfdump does. This is going to help me so much in the future. If you develop in PHP, I think that this class is a must have in your tool kit.

dBug is free! get it today from http://dbug.ospinto.com

  • digg cfdump in php!
  • facebook cfdump in php!
  • stumbleupon cfdump in php!
  • twitter cfdump in php!
  • delicious cfdump in php!
  • reddit cfdump in php!
  • friendfeed cfdump in php!
  • posterous cfdump in php!
  • tumblr cfdump in php!

{ 5 comments… read them below or add one }

1 sean macdonald July 18, 2007 at 11:58 am

this is great! i LOVE cfdump and missed it so much. now we are RE-UNITED!

2 Paul Feakins January 15, 2009 at 9:47 am

Ah yes this is brilliant! There’s also one for Javascript: http://www.netgrow.com.au/files/javascript_dump.cfm

Thanks for posting!
Paul.
http://www.antropyconsulting.com

3 Unibands May 19, 2009 at 5:46 am

Hi, this looks great.

I’m a ColdFusion user, and it’s nice to see such an established language such as PHP borrowing ideas from us. CFDUMP is one of the most valuable things in ColdFusion for debugging.

Hopefully this will hint to PHP users just one of the many things that ColdFusion and CFML have to offer to developers.

ColdFusion is not owned by Adobe, they have an engine, but there are a few others.

Open Source / Free Coldfusion Engines

http://www.openbluedragon.org/about.cfm
http://www.getrailo.org/

ColdFusion has a bad rep, usually down to many misconceptions. The language and the engines and community however are very much alive.

It’s better than ever now to be a CF developer.

Enough of my preaching!!

Thanks,
Mikey.

4 Paul Alkema January 13, 2010 at 5:11 pm

“master of none I guess”.

Humble too, haha. ;)

5 Leighton Tebay November 29, 2010 at 9:51 am

Thanks for helping me make PHP coding a little more civilized. Ahh I miss CFML sometimes.

Leave a Comment

{ 1 trackback }

Previous post:

Next post: