function describe_type in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/guzzle/src/functions.php \GuzzleHttp\describe_type()
Debug function used to describe the provided value type and class.
Parameters
mixed $input:
Return value
string Returns a string containing the type of the variable and if a class is provided, the class name.
File
- vendor/
guzzlehttp/ guzzle/ src/ functions.php, line 42
Namespace
GuzzleHttpCode
function describe_type($input) {
switch (gettype($input)) {
case 'object':
return 'object(' . get_class($input) . ')';
case 'array':
return 'array(' . count($input) . ')';
default:
ob_start();
var_dump($input);
// normalize float vs double
return str_replace('double(', 'float(', rtrim(ob_get_clean()));
}
}