Skip to content

Witer/Html Option to Set Line Ending#4776

Closed
oleibman wants to merge 2 commits intoPHPOffice:masterfrom
oleibman:lineending
Closed

Witer/Html Option to Set Line Ending#4776
oleibman wants to merge 2 commits intoPHPOffice:masterfrom
oleibman:lineending

Conversation

@oleibman
Copy link
Copy Markdown
Collaborator

@oleibman oleibman commented Jan 9, 2026

It currently always uses PHP_EOL, which, of course, works, but you get slightly different results in Windows and Unix. User can now set line ending to \n or \r\n to ensure consistent results regardless of environment. Default remains PHP_EOL. We already do this for CSV.

This is:

  • a bugfix
  • a new feature
  • refactoring
  • additional unit tests

Checklist:

  • Changes are covered by unit tests
    • Changes are covered by existing unit tests
    • New unit tests have been added
  • [ x Code style is respected
  • Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
  • Documentation is updated as necessary

It currently always uses PHP_EOL, which, of course, works, but you get slightly different results in Windows and Unix. User can now set line ending to `\n` or `\r\n` to ensure consistent results regardless of environment. Default remains PHP_EOL. We already do this for CSV.
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Jan 9, 2026
Fix PHPOffice#4776. DefaultValueBinder treats strings that look like scientific notation as floats. However, if Php evaluates them as `INF`, this can cause problems for Excel. A one-line change to DefaultValueBinder avoids this situation. Tests are added for DefaultValueBinder, and also for StringValueBinder and AdvancedValueBinder, although those extend DefaultValueBinder and needed no code changes.
@oleibman
Copy link
Copy Markdown
Collaborator Author

oleibman commented Jan 9, 2026

Something seems wrong with how this PR interacts with PR #4767 and PR #4775. Closing this one. Will resubmit after planned new release this weekend.

@oleibman oleibman closed this Jan 9, 2026
@oleibman oleibman deleted the lineending branch January 11, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant