PHPOffice/PhpSpreadsheet · error · SpreadsheetException

Unable to bind unstringable ' . gettype($value)

Error message

Unable to bind unstringable ' . gettype($value)

What it means

Error "Unable to bind unstringable ' . gettype($value)" thrown in PHPOffice/PhpSpreadsheet.

Source

Thrown at src/PhpSpreadsheet/Cell/StringValueBinder.php:85

        $this->convertNumeric = $suppressConversion;
        $this->convertFormula = $suppressConversion;

        return $this;
    }

    /**
     * Bind value to a cell.
     *
     * @param Cell $cell Cell to bind value to
     * @param mixed $value Value to bind in cell
     */
    public function bindValue(Cell $cell, mixed $value): bool
    {
        if (is_object($value)) {
            return $this->bindObjectValue($cell, $value);
        }
        if ($value !== null && !is_scalar($value)) {
            throw new SpreadsheetException('Unable to bind unstringable ' . gettype($value));
        }

        // sanitize UTF-8 strings
        if (is_string($value)) {
            $value = StringHelper::sanitizeUTF8($value);
        }

        $ignoredErrors = false;
        if ($value === null && $this->convertNull === false) {
            $cell->setValueExplicit($value, DataType::TYPE_NULL);
        } elseif (is_bool($value) && $this->convertBoolean === false) {
            $cell->setValueExplicit($value, DataType::TYPE_BOOL);
        } elseif ((is_int($value) || is_float($value)) && $this->convertNumeric === false) {
            $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
        } elseif (is_string($value) && strlen($value) > 1 && $value[0] === '=' && $this->convertFormula === false && parent::dataTypeForValue($value) === DataType::TYPE_FORMULA) {
            $cell->setValueExplicit($value, DataType::TYPE_FORMULA);
        } else {
            $ignoredErrors = is_numeric($value);

View on GitHub (pinned to 65b080eef4)

When it happens

Trigger: Thrown at src/PhpSpreadsheet/Cell/StringValueBinder.php:85 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of PHPOffice/PhpSpreadsheet@65b080eef4 (2026-08-17). Data as JSON: /api/errors/49855d6562ded139. Report an issue: GitHub.