This is:
- [ ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
when I bind an int type value, I just want to see no warnings.
PHP Notice: Trying to access array offset on value of type int in /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php on line 59
the code on line 59 list below:
} elseif ($pValue[0] === '=' && strlen($pValue) > 1) {
return DataType::TYPE_FORMULA;
}
the type of $pValue is int.
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$pValue = (int) 100;
$pCoordination = 'A1';
$spreadsheet->getActiveSheet()->setCellValue($pCoordination, $pValue);
PhpSpreadsheet: 1.8.2
PHP version: 7.4
PHP version is important here, I encountered this when I upgraded from 7.1 to 7.4, downgraded to 7.3 and it doesn't throw the error.
This issue was fixed in release 1.10.0 of PHPSpreadsheet
Most helpful comment
This issue was fixed in release 1.10.0 of PHPSpreadsheet