15    const M_2DIVPI = 0.63661977236758134307553505349006;
 
   49        'divisionbyzero' => 
'#DIV/0!',
 
   51        'reference' => 
'#REF!',
 
   55        'gettingdata' => 
'#GETTING_DATA',
 
  145        return '#Not Yet Implemented';
 
  155        return self::$errorCodes[
'divisionbyzero'];
 
  169    public static function NA()
 
  171        return self::$errorCodes[
'na'];
 
  181    public static function NAN()
 
  183        return self::$errorCodes[
'num'];
 
  195        return self::$errorCodes[
'name'];
 
  205    public static function REF()
 
  207        return self::$errorCodes[
'reference'];
 
  217    public static function null()
 
  219        return self::$errorCodes[
'null'];
 
  231        return self::$errorCodes[
'value'];
 
  236        return (substr_count($idx, 
'.') <= 1) || (preg_match(
'/\.[A-Z]/', $idx) > 0);
 
  241        return substr_count($idx, 
'.') == 0;
 
  246        return substr_count($idx, 
'.') > 1;
 
  253        if ($condition === 
'') {
 
  256        if (!is_string($condition) || !in_array($condition[0], [
'>', 
'<', 
'='])) {
 
  258            if (is_bool($condition)) {
 
  259                return '=' . ($condition ? 
'TRUE' : 
'FALSE');
 
  260            } elseif (!is_numeric($condition)) {
 
  264            return str_replace(
'""""', 
'""', 
'=' . $condition);
 
  266        preg_match(
'/(=|<[>=]?|>=?)(.*)/', $condition, $matches);
 
  267        [, $operator, $operand] = $matches;
 
  270        if (is_numeric(trim($operand, 
'"'))) {
 
  271            $operand = trim($operand, 
'"');
 
  272        } elseif (!is_numeric($operand) && $operand !== 
'FALSE' && $operand !== 
'TRUE') {
 
  273            $operand = str_replace(
'"', 
'""', $operand);
 
  277        return str_replace(
'""""', 
'""', $operator . $operand);
 
  282        if (is_numeric($operand) || is_bool($operand)) {
 
  285            return strtoupper($operand);
 
  289        if (preg_match(
'/^\-?\d*\.?\d*\s?\%$/', $operand)) {
 
  290            return ((
float) rtrim($operand, 
'%')) / 100;
 
  294        if (($dateValueOperand = Date::stringToExcel($operand)) !== 
false) {
 
  295            return $dateValueOperand;
 
  332        if ($value !== 
null) {
 
  336        return $value === 
null;
 
  346    public static function isErr($value = 
'')
 
  364        if (!is_string($value)) {
 
  368        return in_array($value, self::$errorCodes);
 
  378    public static function isNa($value = 
'')
 
  392    public static function isEven($value = 
null)
 
  396        if ($value === 
null) {
 
  398        } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
 
  402        return $value % 2 == 0;
 
  412    public static function isOdd($value = 
null)
 
  416        if ($value === 
null) {
 
  418        } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
 
  422        return abs($value) % 2 == 1;
 
  436        if (is_string($value)) {
 
  440        return is_numeric($value);
 
  454        return is_bool($value);
 
  464    public static function isText($value = 
null)
 
  499    public static function n($value = 
null)
 
  501        while (is_array($value)) {
 
  502            $value = array_shift($value);
 
  505        switch (gettype($value)) {
 
  514                if ((strlen($value) > 0) && ($value[0] == 
'#')) {
 
  539    public static function TYPE($value = 
null)
 
  542        if (is_array($value) && (count($value) > 1)) {
 
  546            if (self::isCellValue($a)) {
 
  549            } elseif (self::isMatrixValue($a)) {
 
  552        } elseif (empty($value)) {
 
  558        if (($value === 
null) || (is_float($value)) || (is_int($value))) {
 
  560        } elseif (is_bool($value)) {
 
  562        } elseif (is_array($value)) {
 
  564        } elseif (is_string($value)) {
 
  566            if ((strlen($value) > 0) && ($value[0] == 
'#')) {
 
  585        if (!is_array($array)) {
 
  586            return (array) $array;
 
  590        foreach ($array as $value) {
 
  591            if (is_array($value)) {
 
  592                foreach ($value as $val) {
 
  593                    if (is_array($val)) {
 
  594                        foreach ($val as $v) {
 
  598                        $arrayValues[] = $val;
 
  602                $arrayValues[] = $value;
 
  618        if (!is_array($array)) {
 
  619            return (array) $array;
 
  623        foreach ($array as $k1 => $value) {
 
  624            if (is_array($value)) {
 
  625                foreach ($value as $k2 => $val) {
 
  626                    if (is_array($val)) {
 
  627                        foreach ($val as $k3 => $v) {
 
  628                            $arrayValues[$k1 . 
'.' . $k2 . 
'.' . $k3] = $v;
 
  631                        $arrayValues[$k1 . 
'.' . $k2] = $val;
 
  635                $arrayValues[$k1] = $value;
 
  651        while (is_array($value)) {
 
  652            $value = array_shift($value);
 
  668        if ($pCell === 
null) {
 
  674        $cellReference = $matches[6] . $matches[7];
 
  675        $worksheetName = str_replace(
"''", 
"'", trim($matches[2], 
"'"));
 
  677        $worksheet = (!empty($worksheetName))
 
  678            ? $pCell->getWorksheet()->getParent()->getSheetByName($worksheetName)
 
  679            : $pCell->getWorksheet();
 
  681        return $worksheet->getCell($cellReference)->isFormula();
 
An exception for terminatinating execution or to throw for unit testing.
const CALCULATION_REGEXP_CELLREF
static getTRUE()
Return the locale-specific translation of TRUE.
static getFALSE()
Return the locale-specific translation of FALSE.
static wrapResult($value)
Wrap string values in quotes.
static setCompatibilityMode($compatibilityMode)
Set the Compatibility Mode.
const COMPATIBILITY_GNUMERIC
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
const RETURNDATE_PHP_DATETIME_OBJECT
static isText($value=null)
IS_TEXT.
static $compatibilityMode
static isFormula($cellReference='', ?Cell $pCell=null)
ISFORMULA.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
static isOdd($value=null)
IS_ODD.
const COMPATIBILITY_EXCEL
constants
const RETURNDATE_PHP_NUMERIC
static isNa($value='')
IS_NA.
static flattenArrayIndexed($array)
Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.
static TYPE($value=null)
TYPE.
static operandSpecialHandling($operand)
static setReturnDateType($returnDateType)
Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric o...
static isErr($value='')
IS_ERR.
static isError($value='')
IS_ERROR.
static isEven($value=null)
IS_EVEN.
static ifCondition($condition)
static errorType($value='')
ERROR_TYPE.
static isLogical($value=null)
IS_LOGICAL.
static isNonText($value=null)
IS_NONTEXT.
static isBlank($value=null)
IS_BLANK.
const RETURNDATE_UNIX_TIMESTAMP
const RETURNDATE_PHP_OBJECT
static isNumber($value=null)
IS_NUMBER.
static isMatrixValue($idx)
const COMPATIBILITY_OPENOFFICE
static getCompatibilityMode()
Return the current Compatibility Mode.
static getReturnDateType()
Return the current Return Date Format for functions that return a date/time (Excel,...