{"record":{"id":"f4721eb9caa4d620","repo":"PHPOffice/PhpSpreadsheet","slug":"unable-to-bind-unstringable-gettype-value","errorCode":null,"errorMessage":"Unable to bind unstringable {gettype($value)}","messagePattern":"Unable to bind unstringable (.+?)","errorType":"exception","errorClass":"PhpOffice\\PhpSpreadsheet\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Cell/DefaultValueBinder.php","lineNumber":43,"sourceCode":"     */\n    public function bindValue(Cell $cell, mixed $value): bool\n    {\n        // sanitize UTF-8 strings\n        if (is_string($value)) {\n            $value = StringHelper::sanitizeUTF8($value);\n        } elseif ($value === null || is_scalar($value) || $value instanceof RichText) {\n            // No need to do anything\n        } elseif ($value instanceof DateTimeInterface) {\n            $value = $value->format('Y-m-d H:i:s');\n        } elseif ($value instanceof Stringable) {\n            $value = (string) $value;\n        } elseif ($value instanceof BaseDrawing) {\n            $value->setCoordinates($cell->getCoordinate());\n            $value->setResizeProportional(false);\n            $value->setInCell(true);\n            $value->setWorksheet($cell->getWorksheet(), true);\n        } else {\n            throw new SpreadsheetException('Unable to bind unstringable ' . gettype($value));\n        }\n\n        // Set value explicit\n        $cell->setValueExplicit($value, static::dataTypeForValue($value));\n\n        // Done!\n        return true;\n    }\n\n    /**\n     * DataType for value.\n     */\n    public static function dataTypeForValue(mixed $value): string\n    {\n        // Match the value against a few data types\n        if ($value === null) {\n            return DataType::TYPE_NULL;\n        }","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Cell/DefaultValueBinder.php#L25-L61","documentation":"Error \"Unable to bind unstringable {gettype($value)}\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Cell/DefaultValueBinder.php:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}