OpenOffice.php 1.9 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. return [
  3. 'OO allows CHAR(0)' => ["\x00", '=CHAR(0)'],
  4. 'OO treats CODE(bool) as 0/1' => ['48', '=CODE(FALSE)'],
  5. 'OO treats bool as string as 0/1 to REPT' => ['111', '=REPT(true, 3)'],
  6. 'OO treats bool as string as 0/1 to CLEAN' => ['0', '=CLEAN(false)'],
  7. 'OO treats bool as string as 0/1 to TRIM' => ['1', '=TRIM(true)'],
  8. 'OO treats bool as string as 0/1 to LEN' => ['1', '=LEN(false)'],
  9. 'OO treats bool as string as 0/1 to EXACT parm 1' => [true, '=EXACT(true, 1)'],
  10. 'OO treats bool as string as 0/1 to EXACT parm 2' => [true, '=EXACT(0, false)'],
  11. 'OO treats bool as string as 0/1 to FIND parm 1' => [2, '=FIND(true, "210")'],
  12. 'OO treats bool as string as 0/1 to FIND parm 2' => [1, '=FIND(0, false)'],
  13. 'OO treats true as int 1 to FIND parm 3' => [1, '=FIND("a", "aba", true)'],
  14. 'OO treats false as int 0 to FIND parm 3' => ['#VALUE!', '=FIND("a", "aba", false)'],
  15. 'OO treats bool as string as 0/1 to SEARCH parm 1' => [2, '=SEARCH(true, "210")'],
  16. 'OO treats bool as string as 0/1 to SEARCH parm 2' => [1, '=SEARCH(0, false)'],
  17. 'OO treats true as int 1 to SEARCH parm 3' => [1, '=SEARCH("a", "aba", true)'],
  18. 'OO treats false as int 0 to SEARCH parm 3' => ['#VALUE!', '=SEARCH("a", "aba", false)'],
  19. 'OO treats true as 1 to REPLACE parm 1' => ['10', '=REPLACE(true, 3, 1, false)'],
  20. 'OO treats false as 0 to REPLACE parm 4' => ['he0lo', '=REPLACE("hello", 3, 1, false)'],
  21. 'OO treats false as 0 SUBSTITUTE parm 1' => ['6', '=SUBSTITUTE(true, "1", "6")'],
  22. 'OO treats true as 1 SUBSTITUTE parm 4' => ['zbcade', '=SUBSTITUTE("abcade", "a", "z", true)'],
  23. 'OO TEXT boolean in lieu of string' => ['0', '=TEXT(false, "@")'],
  24. 'OO VALUE boolean in lieu of string' => ['0', '=VALUE(false)'],
  25. 'OO NUMBERVALUE boolean in lieu of string' => ['1', '=NUMBERVALUE(true)'],
  26. 'OO TEXTJOIN boolean in lieu of string' => ['1-0-1', '=TEXTJOIN("-", true, true, false, true)'],
  27. ];