{"record":{"id":"652a040819037424","repo":"PHPOffice/PhpSpreadsheet","slug":"unable-to-bind-unstringable-object-of-type-get","errorCode":null,"errorMessage":"Unable to bind unstringable object of type ' . get_class($value)","messagePattern":"Unable to bind unstringable object of type ' \\. get_class\\(\\$value\\)","errorType":"exception","errorClass":"SpreadsheetException","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Cell/StringValueBinder.php","lineNumber":127,"sourceCode":"\n        return true;\n    }\n\n    protected function bindObjectValue(Cell $cell, object $value): bool\n    {\n        // Handle any objects that might be injected\n        $ignoredErrors = false;\n        if ($value instanceof DateTimeInterface) {\n            $value = $value->format('Y-m-d H:i:s');\n            $cell->setValueExplicit($value, DataType::TYPE_STRING);\n        } elseif ($value instanceof RichText) {\n            $cell->setValueExplicit($value, DataType::TYPE_INLINE);\n            $ignoredErrors = is_numeric($value->getPlainText());\n        } elseif ($value instanceof Stringable) {\n            $cell->setValueExplicit((string) $value, DataType::TYPE_STRING);\n            $ignoredErrors = is_numeric((string) $value);\n        } else {\n            throw new SpreadsheetException('Unable to bind unstringable object of type ' . get_class($value));\n        }\n        if ($this->setIgnoredErrors) {\n            $cell->getIgnoredErrors()->setNumberStoredAsText($ignoredErrors);\n        }\n\n        return true;\n    }\n}\n","sourceCodeStart":109,"sourceCodeEnd":136,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Cell/StringValueBinder.php#L109-L136","documentation":"Error \"Unable to bind unstringable object of type ' . get_class($value)\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Cell/StringValueBinder.php:127 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"}