{"record":{"id":"5cbb149e53e0330b","repo":"PHPOffice/PhpSpreadsheet","slug":"unsupported-biff8-constant","errorCode":null,"errorMessage":"Unsupported BIFF8 constant","messagePattern":"Unsupported BIFF8 constant","errorType":"exception","errorClass":"PhpOffice\\PhpSpreadsheet\\Reader\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Reader/Xls/Biff8.php","lineNumber":96,"sourceCode":"                break;\n            case 0x04: // boolean\n                // offset: 1; size: 1; 0 = FALSE, 1 = TRUE\n                if (ord($valueData[1])) {\n                    $value = 'TRUE';\n                } else {\n                    $value = 'FALSE';\n                }\n                $size = 9;\n\n                break;\n            case 0x10: // error code\n                // offset: 1; size: 1; error code\n                $value = ErrorCode::lookup(ord($valueData[1]));\n                $size = 9;\n\n                break;\n            default:\n                throw new ReaderException('Unsupported BIFF8 constant');\n        }\n\n        return [\n            'value' => $value,\n            'size' => $size,\n        ];\n    }\n\n    /**\n     * Read BIFF8 cell range address list\n     * section 2.5.15.\n     *\n     * @return array{size: int, cellRangeAddresses: mixed[]}\n     */\n    public static function readBIFF8CellRangeAddressList(string $subData): array\n    {\n        $cellRangeAddresses = [];\n","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Reader/Xls/Biff8.php#L78-L114","documentation":"When a formula's array constant (tArray / shared constant pool) is decoded, each element's type byte must be 0x01 (number), 0x02 (string), or 0x10 (error/boolean family handled above it). Anything else raises this ReaderException from Biff8::readBIFF8Constant.","triggerScenarios":"Corrupt array-constant bytes inside a FORMULA record, or a writer that emitted an element type the spec does not define (e.g. an experimental/newer constant type).","commonSituations":"Workbooks containing array formulas ({=...}) produced by third-party generators; files with bit-level damage; uploads processed by broken antivirus/rewrite proxies.","solutions":["Open the workbook in Excel, re-enter the array formula normally, and re-save","Convert to .xlsx via LibreOffice and read with the Xlsx reader","Use setReadDataOnly(true) to bypass formula parsing when only cell values are required"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    $spreadsheet = IOFactory::load($path);\n} catch (\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e) {\n    if (str_contains($e->getMessage(), 'Unsupported BIFF8 constant')) {\n        $reader = (new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xls())->setReadDataOnly(true);\n        $spreadsheet = $reader->load($path);\n    }\n}","preventionTips":["Re-enter array formulas in Excel and re-save before import","Convert to .xlsx when array constants must survive","Skip formulas with setReadDataOnly(true) when only values are consumed"],"tags":["xls","biff8","array-formula","phpspreadsheet"],"backgroundTag":"malformed-formula-token","analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}