Tuesday, September 18, 2007

Try Zend Framework vol.2 "Debug Utils"

It's sometimes annoying to type "print_r" "get_class_methods".
"print_r" has 7 characters.
"get_class_methods" has 17 characters.
It just unbelievable!!
You might get hurt on your fingers.
And they just show the results as messy. It's not easy to read.

Zend Framework gives us a great class "Zend_Debug" for debugging.
It formats the result for you to read easily!

But, when you use the class you still need to type "Zend_Debug::dump()".
muu...18 characters. :<>
<php
require_once 'Zend/Debug.php';

function d($val)
{
Zend_Debug::dump($val);
}

function m($val)
{
Zend_Debug::dump(get_class_methods($val));
}


It's just simple functions but gives you time to make coffee instead of typing a lot of long letter functions. Isn't it? :p

(weight 85.4kg BMI 30%)

Labels:

0 Comments:

Post a Comment

<< Home