Thursday, January 20, 2011

PHP improved gettype function

It's short and simple and more informative:

function get_type(&$v) {
return ($type = gettype($v))=="object" ? get_class($v) : $type;
}

Merge of PHP::gettype and PHP::get_class functions