mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-24 19:18:18 +00:00
ad2194d737
The CONCATENATE function has been treated as equivalent to CONCAT. This is not how it is treated in Excel; it is closer to (and probably identical to) the ampersand concatenate operator. The difference manifests itself when any of the arguments is an array (typically a cell range). Code is added to support this difference. Support for array results is added to Csv Writer, Html Writer, and Ods Reader and Writer. I have not figured out how to get it to work with Xls.
40 lines
791 B
PHP
40 lines
791 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use PhpOffice\PhpSpreadsheet\Cell\DataType;
|
|
|
|
return [
|
|
[
|
|
'ABCDEFGHIJ',
|
|
'ABCDE',
|
|
'FGHIJ',
|
|
],
|
|
[
|
|
'123',
|
|
1,
|
|
2,
|
|
3,
|
|
],
|
|
[
|
|
'Boolean-TRUE',
|
|
'Boolean',
|
|
'-',
|
|
true,
|
|
],
|
|
'no arguments' => ['exception'],
|
|
'result just fits' => [
|
|
// Note use Armenian character below to make sure chars, not bytes
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5) . 'ABCDE',
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5),
|
|
'ABCDE',
|
|
],
|
|
'result too long' => [
|
|
'#CALC!',
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5),
|
|
'abc',
|
|
'=A2',
|
|
],
|
|
'propagate DIV0' => ['#DIV/0!', '1', '=2/0', '3'],
|
|
];
|