TEXTJOIN.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. use PhpOffice\PhpSpreadsheet\Cell\DataType;
  3. return [
  4. [
  5. 'ABCDE,FGHIJ',
  6. [',', true, 'ABCDE', 'FGHIJ'],
  7. ],
  8. [
  9. 'ABCDEFGHIJ',
  10. ['', true, 'ABCDE', 'FGHIJ'],
  11. ],
  12. [
  13. '1-2-3',
  14. ['-', true, 1, 2, 3],
  15. ],
  16. [
  17. '<<::>>',
  18. ['::', true, '<<', '>>'],
  19. ],
  20. [
  21. 'Καλό απόγευμα',
  22. [' ', true, 'Καλό', 'απόγευμα'],
  23. ],
  24. [
  25. 'Boolean-TRUE',
  26. ['-', true, 'Boolean', '', true],
  27. ],
  28. [
  29. 'Boolean-TRUE',
  30. ['-', true, 'Boolean', ' ', true],
  31. ],
  32. [
  33. 'Boolean--TRUE',
  34. ['-', false, 'Boolean', '', true],
  35. ],
  36. [
  37. 'C:\\Users\\Mark\\Documents\\notes.doc',
  38. ['\\', true, 'C:', 'Users', 'Mark', 'Documents', 'notes.doc'],
  39. ],
  40. 'no argument' => ['exception', []],
  41. 'one argument' => ['exception', ['-']],
  42. 'two arguments' => ['exception', ['-', true]],
  43. 'three arguments' => ['a', ['-', true, 'a']],
  44. 'boolean as string' => ['TRUE-FALSE-TRUE', ['-', true, true, false, true]],
  45. 'result too long' => [
  46. '#CALC!',
  47. [
  48. ',',
  49. true,
  50. str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5),
  51. 'abcde',
  52. ],
  53. ],
  54. 'result just fits' => [
  55. str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5) . ',abcd',
  56. [
  57. ',',
  58. true,
  59. str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5),
  60. 'abcd',
  61. ],
  62. ],
  63. 'propagate REF' => ['#REF!', [',', true, '1', '=sheet99!A1', '3']],
  64. 'propagate NUM' => ['#NUM!', [',', true, '1', '=SQRT(-1)', '3']],
  65. ];