/** * Format type and details of an operand for display in the log (based on operand type) * * @param mixed $value First matrix operand * @return mixed */ private static function _showTypeDetails($value) { $testArray = Calculation_Functions::flattenArray($value); if (count($testArray) == 1) { $value = array_pop($testArray); } switch (gettype($value)) { case 'double': case 'float': $typeString = 'a floating point number'; break; case 'integer': $typeString = 'an integer number'; break; case 'boolean': $typeString = 'a boolean'; break; case 'array': $typeString = 'a matrix'; break; case 'string': if ($value == '') { return 'an empty string'; } elseif ($value[0] == '#') { return 'a ' . $value . ' error'; } else { $typeString = 'a string'; } break; case 'NULL': return 'a null value'; } return $typeString . ' with a value of ' . self::_showValue($value); }