Adriano Adriano c69391d419 # This is a combination of 13 commits.
# This is the 1st commit message:

Integrated unit test to capture the bug.

# This is the commit message #2:

Added Date.safeModify() method for secure DateTime modifications and integrated exception handling - Fixed #4840.

# This is the commit message #3:

PHPCS Fixes.

# This is the commit message #4:

PHPCS Fixes.

# This is the commit message #5:

Codestyle fix.

# This is the commit message #6:

Added description to CHANGELOG.md.

# This is the commit message #7:

Enhanced Date.safeModify() to ensure consistent exception handling across PHP versions, addressing changes in DateTime::modify() behavior in PHP 8.3 - #4840.

# This is the commit message #8:

Confusion Checking for Union Arguments

Fix #4832. PR #4657 added support for passing union arguments to functions. User reports a problem with a peculiar formula afterwards. See issue for details - the very loose restrictions placed on worksheet names can lead to an ambiguous situation for the parser.

This problem arose with a function whose first argument was a cell address *including sheet name*. Parser is changed to try to avoid this situation. If the regular expression which tells us we have a potential need for union has a left parenthesis in the "sheet name" without a right parenthesis, then it will no longer try to treat the formula as containing union arguments except in the unlikely event that "sheet name" truly is a worksheet title in the spreadsheet. This feels pretty kludgey, but it solves the problem at hand, and seems unlikely to cause problems. There may still be edge cases more subtle than the one in the issue; I am satisfied to wait for reports of such.

# This is the commit message #9:

Weird Regexp Difference between Php8.4+ and Php8.3-

Specify codeCoverageIgnore for now, remove later.

# This is the commit message #10:

Move Test to More Sensible Location

# This is the commit message #11:

Ods Reader/Writer Support for Integer Styles with Leading Zero

Fix #1606, which went stale and is now reopened. PR #4806 supplied support for some Number Formats for Ods, but did not directly address this issue. This PR does. In addition to the original issue, this could be useful for zip codes. As I stated in 4806, I may be amenable to adding some unsupported styles to the built-in list, but the custom style option will always be around in case I am being slow or unreasonable.

# This is the commit message #12:

A Bit More Flexibility

And some more tests.

# This is the commit message #13:

Update CHANGELOG.md

Xlsx Writer Support Data URI for Images

Fix #4823. When writing a spreadsheet to Html, a data Uri can be used if `embedImages` is true. Reading such an Html spreadsheet and attempting to write it to Xlsx results in an Exception. It should be noted that Excel itself cannot open the Html properly; none of the images are present.

The PhpSpreadsheet problem arises not with the inclusion of the image, but rather with attempting to include the appropriate entry in `[ContentTypes].xml`. This PR corrects that problem.

For the record, Xls Writer does not have a problem with this situation. Just to demonstrate that, a parallel test for Xls Writer is added in addition to the new Xlsx Writer test.

Update CHANGELOG.md

Update CHANGELOG.md

Added phpcs and php-cs-fixer corrections #4840.

Updated DateTest to handle DateMalformedStringException for PHP 8.3 in excelToDateTimeObject exception tests.

Fixed phpcs issues.

Fixed php-cs-fixer issue.

Updated DateTest so to not directly reference DateMalformedStringException class which is not existing prior to PHP 8.3.

Refactored DateTest to dynamically set the expected exception class, ensuring compatibility across PHP versions.

Removed unused Throwable import and updated expected exception type in DateTest for consistency with PHP version handling.

Added DateMalformedStringException polyfill to solve the phpstan issue.

Fixed phpcs issue.
2026-03-21 15:09:06 +01:00
2026-03-02 16:58:22 -08:00
2025-12-27 16:15:30 -08:00
2026-03-04 22:15:58 -08:00
2026-03-04 22:15:58 -08:00

PhpSpreadsheet

Build Status Code Coverage Total Downloads Latest Stable Version License Join the chat at https://gitter.im/PHPOffice/PhpSpreadsheet

PhpSpreadsheet is a library written in pure PHP and offers a set of classes that allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.

This is the master branch, and is maintained for security and bug fixes.

PHP Version Support

LTS: For maintained branches, support for PHP versions will only be maintained for a period of six months beyond the end of life of that PHP version.

Currently the required PHP minimum version is PHP 8.1, and we will support that version until 30th June 2026.

See the composer.json for other requirements.

Installation

See the install instructions.

Documentation

Read more about it, including install instructions, in the official documentation. Or check out the API documentation.

Please ask your support questions on StackOverflow, or have a quick chat on Gitter.

Patreon

I am now running a Patreon to support the work that I do on PhpSpreadsheet.

Supporters will receive access to articles about working with PhpSpreadsheet, and how to use some of its more advanced features.

Posts already available to Patreon supporters:

  • The Dating Game
    • A look at how MS Excel (and PhpSpreadsheet) handle date and time values.
  • Looping the Loop
    • Advice on Iterating through the rows and cells in a worksheet.

And for Patrons at levels actively using PhpSpreadsheet:

  • Behind the Mask
    • A look at Number Format Masks.

The Next Article (currently Work in Progress):

  • Formula for Success
    • How to debug formulae that don't produce the expected result.

My aim is to post at least one article each month, taking a detailed look at some feature of MS Excel and how to use that feature in PhpSpreadsheet, or on how to perform different activities in PhpSpreadsheet.

Planned posts for the future include topics like:

  • Tables
  • Structured References
  • AutoFiltering
  • Array Formulae
  • Conditional Formatting
  • Data Validation
  • Value Binders
  • Images
  • Charts

After a period of six months exclusive to Patreon supporters, articles will be incorporated into the public documentation for the library.

PHPExcel vs PhpSpreadsheet ?

PhpSpreadsheet is the next version of PHPExcel. It breaks compatibility to dramatically improve the code base quality (namespaces, PSR compliance, use of latest PHP language features, etc.).

Because all efforts have shifted to PhpSpreadsheet, PHPExcel will no longer be maintained. All contributions for PHPExcel, patches and new features, should target PhpSpreadsheet master branch.

Do you need to migrate? There is an automated tool for that.

License

PhpSpreadsheet is licensed under MIT.

Languages
PHP 99.8%
HTML 0.2%