Login  |  Packages  |  Support  |  Bugs
PECL is deprecated.

Have you heard about PIE? 🥧 PHP Installer for Extensions (PIE) is the replacement for PECL. We recommend publishing your extension using PIE instead.

Find out more at https://github.com/php/pie.

Return

Changelog for xlswriter
Release What has changed?
3.0.0 - Feature: formula calculation. evaluateFormula(string $formula) evaluates an Excel formula and returns its result — operator precedence and arithmetic, cell and range references (A1, A1:A3) resolved against the values already written, aggregates (SUM / AVERAGE / MIN / MAX / COUNT / COUNTA), and logical/text functions (IF, CONCATENATE, UPPER, LEN, ...), with Excel error values (#DIV/0!, #NUM!, ...) surfaced as strings. computeFormula(bool $enable = true) opts the workbook into caching, so insertFormula() writes the computed <v> result into the file and other readers see the value without recalculating.
- Feature: round-trip editing of an existing workbook. openFile() a saved .xlsx and change it in place — cell values, styles, merged ranges, dates and sheet dimensions — add new worksheets, and insert images and charts into the opened workbook, then output() the result. The existing write methods (insertText / insertImage / insertChart / mergeCells / setRow / addSheet, ...) work unchanged in edit mode; unsupported edit operations are now reported instead of being silently dropped.
- Performance: normal-mode (non constant_memory) export is about 27% faster with roughly 18% lower peak memory; the constant_memory streaming path gained an integer fast-path that skips float formatting for whole-number cells.
- Fix: the reader returned 0 for negative or zero decimals read through nextCellCallback (the numeric branch was selected on the sign of the value instead of its parsed type); negative and fractional values now read back correctly.
- Fix: locale independence. Numbers are written and parsed with a '.' decimal point regardless of the host LC_NUMERIC, so using the extension under a ','-decimal locale (for example after setlocale(LC_ALL, 'de_DE')) no longer corrupts written values or misreads cell values, row heights, column widths and font sizes.
- Fix: the formula engine is hardened against malformed or hostile input passed to evaluateFormula — deeply nested or over-long expressions can no longer overflow the stack, and an oversized range aggregate such as SUM(A1:XFD1048576) returns #NUM! instead of hanging.
- Fix: numerous memory-safety and robustness corrections across the reader, the edit path and XML output, including NULL-dereference guards on allocation failure.
- Note: 3.0.0 is a major release — the reader and writer now share a single unified core alongside the new formula and round-trip editing engines above. All existing class methods, signatures and Excel::* / Format::* constant values are unchanged, so upgrading requires no code changes.
2.0.3 - Feature: autoSize(?string $range = null) sizes columns to fit their content. Column widths are estimated from the written cell values (wide/CJK code points count as two columns) and applied at output() time. Tracking is opt-in (call autoSize() before the writes it should size), so writes that never use it pay no per-cell cost; widths are clamped to Excel's 255 max (#305 / #514).
- Performance: worksheet metadata (merges, hyperlinks, protection, row/col options) is now loaded lazily instead of eagerly at openSheet(), so data-only reads (getSheetData / nextRow / nextCellCallback / putCSV) skip the second full XML pass — about 40% faster on large sheets.
- Performance: merge-follow lookups (SKIP_MERGED_FOLLOW) are indexed by last_row with a forward cursor, turning the per-cell scan from O(cells × merges) into amortised near-O(1).
- Fix: RichString leaked one zend_string per instance (the constructor's zend_string_copy was never released) and its fetch-object offset pointed at the wrong struct; both corrected.
- Fix: the cell/row-end/image/comment/chart callback bridges no longer zval_ptr_dtor an uninitialised return value when a callback throws or the call fails.
- Fix: xlsx_to_csv leaked its temp row on the write-failure path; openFile() now resets reader bookkeeping the way openSheet() and the dtor do; fileName()/constMemory() handle workbook/worksheet allocation failure instead of dereferencing NULL.
- Fix: the reader now reads every image from drawing.xml instead of stopping after the first 64 KB.
- Fix: PHP 8.6 compatibility — XtOffsetOf replaced with the standard offsetof, and zval_dtor with zval_ptr_dtor_nogc.
- Fix: setColumn()/setRow() leaked the per-call row/col options struct, and insertImage() leaked the path zend_string (#573).
2.0.2 - Feature: insertImageOpt($row, $col, $path, $options) adds pixel-precise x_offset / y_offset within the anchor cell, scale via width/height, a "don't move or size with cells" anchor mode, plus mouseover tip, alt text (description / decorative) and a hyperlink overlay. Object positioning is exposed through new Excel::OBJECT_POSITION_* constants. The original insertImage() signature is untouched (#357 / #437 / #473 / #297 / #449).
- Feature: insertDynamicFormula() and insertDynamicArrayFormula() emit the t="array" + ref-range XML that Excel 365 dynamic array functions (UNIQUE, FILTER, SORT, SEQUENCE, XLOOKUP, etc.) require, which insertFormula() does not produce (#503).
- Feature: outlineSettings(bool $visible = true, bool $below = true, bool $right = true, bool $autoStyle = false) configures worksheet outline (grouping) display (#540).
- Fix: PHP true/false passed to writeSheet / data now writes a real boolean cell (xlsx type="b") via worksheet_write_boolean; previously bool fell through type_writer() silently and the cell was emitted as blank (#543).
2.0.1 - Fix: insertDate / insertText with $format string now caches each distinct format on its own cache slot; previously ZEND_STRL on a zend_string flexible-array key collapsed every format into one entry, so the first format won and every subsequent call returned the wrong cached format (#552 / #548 / #544).
- Fix: format_copy() now carries font_name (and font_scheme / has_font / has_dxf_font), so a Format resource passed alongside a num-format string keeps the caller's font() instead of falling back to Calibri (#545 / #472).
- Fix: data-validation inline list now rejects with an exception when the joined CSV exceeds Excel's 255-character spec limit, instead of overflowing libxlsxwriter's fixed-size buffer (#486 / #530 / #546).
- Fix: header() called after data() throws instead of silently overwriting the first data row (#535).
- Fix: empty-string sheet name is rejected up-front instead of producing an xlsx that Excel can't open (#528).
- Fix: outline-level warnings in setColumn / setRow / defaultRowOptions use %ld instead of %d so the build no longer fails on Alpine 3.22 + gcc 14 hardening defaults (#556).
- Build: tests + examples now parse on PHP 7.0 (the declared minimum); CI matrix expanded to PHP 7.0-7.3 on ubuntu-22.04 (#565).
- Build: composer.json declares download-url-method=pre-packaged-source so `pie install viest/xlswriter` fetches the self-contained xlswriter-(version).tgz attached to the GitHub release instead of the submodule-less packagist zipball.
2.0.0 - Refactor: replaced libxlsxio dependency with the in-tree libxlsxreader (PHP-agnostic C library, lives under library/libxlsxreader/).
- Reader: shared-strings table now supports both FULL and STREAMING modes; FSM-driven worksheet parser with 64KB XML buffer; honors 1900 vs 1904 date systems via workbook.xml.
- Reader: PHP API (openFile/openSheet/nextRow/nextCellCallback/getSheetData/setType/setGlobalType/setSkipRows/putCSV/putCSVCallback) is fully backward compatible.
- Reader: surface sheet-level metadata — getMergedCells, getHyperlinks, getSheetProtection, getRowOptions/getColumnOptions, getDefaultRowHeight/getDefaultColumnWidth, getDefinedNames, sheetListWithMeta.
- Reader: surface page setup, rich-text runs, comments, charts, and conditional formats — getPageSetup, nextRowRich, iterateImages, iterateComments, iterateCharts, getConditionalFormats.
- Reader: full formula attributes (next-row-with-formula), data validations (getDataValidations), autofilter (getAutoFilter); new static helper Excel::getFormulaAst() for tokenizing formulas without evaluation.
- Reader: getStyleFormat resolves a style id to a rich array of font/fill/border/alignment/protection.
- Writer: conditional formats (Vtiful\Kernel\ConditionalFormat + conditionalFormatCell/Range).
- Writer: Excel tables (Vtiful\Kernel\Table + addTable).
- Writer: page setup — setHeader/setFooter, repeatRows/repeatColumns, printArea, horizontalPageBreaks/verticalPageBreaks, fitToPages, setTabColor.
- Writer: workbook properties — setProperties, setCustomProperty.
- Writer: defined names — defineName (workbook- and sheet-scoped).
- Writer: insertCommentOpt, insertImageBuffer, setBackgroundImage/Buffer, insertRichText.
- Format: borderColorOfTheFourSides, borderOfTheFourSides, indent, rotation, locked/unlocked/hidden cell protection.
- Fix: setBackgroundImage / setBackgroundImageBuffer now bundle the referenced media inside the xlsx (the sheet's picture relationship pointed at a media file that was never written).
- Fix: setHeader/setFooter with image_left/image_center/image_right options now produces a valid xlsx (header VML drawing and content-type registration were missing, making the output unopenable).
- New constants: Excel::COMMENT_DISPLAY_DEFAULT / HIDDEN / VISIBLE so insertCommentOpt(['visible' => …]) callers don't have to guess libxlsxwriter's lxw_comment_display enum.
- Build: feature-flagged reader (--disable-reader produces a write-only build); minizip is shared between writer and reader.
- Update libxlsxwriter from 1.1.3 to 1.1.6.
1.5.8 - Fix: insertDate format.
- Feat: format rotation.
1.5.7 - Fix: insertDate memory leak.
1.5.6 - Fix: format resource memory leak.
1.5.5 - Feat: static built.
1.5.4 - Fix: PACKED array on PHP 8.2.
1.5.3 - Feat: Print scale.
- Feat: Border color.
- Fix: PACKED array on PHP 8.2.
1.5.2 - Fix: Write failure on data reference.
- Fix: String is not zero-terminatedpage.
1.5.1 - Feat customize to enable or disable zip64.
1.5.0 - Feat set current line.
- Feat get current line.
- Feat rich string.
1.4.0 - Fix disable reader build failed.
- Fix insertDate use curtom format segmentation fault.
- Feat custom free resource.
- Feat writer validation.
- Feat writer data validation can be applied to a single cell or a range of cells.
- Feat reader add file path in open file exception message.
- Feat exit worksheet.
- Feat set paper.
- Feat set margins.
- Build read module is enabled by default.
- Perfect exception message.
- Compatible PHP 8.1 API.
- Destructive rename method setPrintedLandscape to setLandscape
- Destructive rename method setPrintedPortrait to setPortrait
1.3.7 - Fix IBM s390x.
- Fix header line no and sheet checkout not init line no.
- Fix single instance opens multiple files, but the file handle is not released.
- Feat worksheet printed.
- Feat worksheet hidden.
- Feat workbook custom first worksheet.
- Feat custom skip hidden rows.
- Feat skip empty rows.
- Feat set global type.
- Feat url text and tool tip.
- Feat work sheet protection.
- Helper xlswriter_get_version and xlswriter_get_author
1.3.6 - Fix musllibc.
- Fix null in cell callback.
- Feat cell comment.
- Feat timestampFromDateDouble static method.
- Feat Check for existence before opening file.
1.3.5 - Feat activate sheet.
- Feat mergeCells type writer.
1.3.4.1 - Feat directory not exist error change to exception.
- Windows full function support.
1.3.4 - FEAT header support custom format.
- FEAT putcsv custom delimiter.
- FEAT ead skip cells,rows,empty value.
- FIX read data method, the offset of the array index and the row of the cell.
- FIX insertDate leaked.
1.3.3.2 - FIX free up stale sheets.
1.3.3.1 - FIX merge cells.
1.3.3 - FEAT mergeCells and insertFormula support format.
- FEAT put csv with callback.
- FEAT global default format.
- FIX READ turning data into custom types.
1.3.2 - FEAT display or hide screen and print gridlines.
- FEAT worksheet zoom.
- FEAT data method is written by default from the file header.
- FEAT returns null if the type is specified and the cell is empty.
- FEAT sheet list.
- FEAT xlsx to csv.
1.3.1 - FEAT freeze panes
- FEAT set font
- Refactor format background
1.3.0 - FEAT read numeric
- FEAT column index from string and string from column index
1.2.9 - FEAT read skip empty cell
- FEAT read skip empty row
- FEAT read data with type array index
- FEAT read global cell data type
- FEAT read new read handler, nextCallback
1.2.8 - FEAT insert date.
- FEAT read data with type
- FEAT work book is not initialized exception
- FIX: minizip multiple definition
1.2.7 - FEAT read xlsx file.
- FIX multiple file segmentation fault.
1.2.6 - FIX CentOS6 Build.
- FIX InsertText memory leaks.
1.2.5 - FEAT cells background color.
- FEAT checkout sheet.
- FEAT format new font size.
- FEAT format new strikeout.
- FEAT insertText support resource format.
1.2.4 - FEAT format multiple style overlays.
- FEAT format text color.
- FEAT image scale.
- FEAT chart.

Return

PRIVACY POLICY  |  CREDITS
Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 13:08:36 2026 UTC
Bandwidth and hardware provided by: pair Networks