NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #3305 most downloaded on Packagist
Lightweight and very fast XLSX Excel Spreadsheet and CSV Reader in PHP
Latest stable
v4.5.0
Last release 1 months ago
08 Oct 2026
Ships fairly regularly
a new release about every 4 weeks
Some releases are documented
notes for 23 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
87 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
Explicit openXlsx(): Excel, openCsvBook(): CsvBook and openCsvReader(): CsvReader factories. CSV factories preserve the constructor options and accept
openXlsx(): Excel, openCsvBook(): CsvBook and openCsvReader(): CsvReader
factories. CSV factories preserve the constructor options and accept empty CSV files.wrapText="1" and wrapText="true" are recognised.validate() restores the libxml error mode, collects this call's XML errors across all parts,
supports special filenames through the ZIP fallback, and rejects missing required package parts.
It clears the shared libxml diagnostic buffer before/after the call; it is not schema validation.openCsv() continues to return CsvReader in 4.x. A return type change to CsvBook is
planned for 5.0. Use openCsvReader() for stable low-level access or openCsvBook() for
the book/sheet API. Existing successful reads and factory signatures remain unchanged.ext-dom is now an explicit Composer requirement: XLSX parsing already uses DOM through
XMLReader::expand(). CSV/XLS-only installations without DOM must enable it before upgrading.close() or a disk-backed shared string cache.openXlsx(): Excel, openCsvBook(): CsvBook и openCsvReader(): CsvReader.
CSV-фабрики сохраняют опции конструктора и допускают пустой CSV.wrapText="1" и wrapText="true".validate() восстанавливает режим libxml, собирает XML-ошибки текущего вызова по всем частям,
поддерживает специальные символы в именах через ZIP fallback и отклоняет отсутствие
обязательных частей пакета. Общий буфер libxml очищается до/после вызова; это не проверка схемы.openCsv() продолжает возвращать CsvReader в 4.x. В 5.0 планируется возврат CsvBook.
Для стабильного низкоуровневого API используйте openCsvReader(), для API книги и листа —
openCsvBook(). Существующие успешные чтения и сигнатуры фабрик сохраняются.ext-dom теперь явно указан в Composer: XLSX-парсер уже использует DOM через
XMLReader::expand(). Установкам только для CSV/XLS без DOM потребуется включить его перед обновлением.close() книги или дисковый кэш общих строк.Your coding agent can read these notes before it upgrades. Set up the MCP server →
The cached string result of a formula is decoded like any other string. A calculated cell keeps its result in the sheet under the type str, and versio
str, and version 4.4.1 taught the reader to turn
_xHHHH_ sequences back into the characters they stand for - but only for shared and inline
strings, so formula results kept coming back escaped. A concatenation carrying a line break,
=B1&C1 over cells holding one, returned the literal text _x000D_ instead of a CR. The type
such a cell reports is unchanged: a numeric formula result is still cast to int or float, and
the cell metadata still says str.A number format the file declares itself is no longer mistaken for the builtin format its index stands for. The format numbers 14-22, 27-36, 45-47, 50
043, stored as 43 under the custom pattern 000, came back as a timestamp of
1900-02-12 with no error raised. The declared pattern now decides, for the cell value as well
as for format-category of the cell style; a number used without a declaration still means
the builtin format it always did.Characters stored as _xHHHH_ are decoded back to the character they stand for. XML cannot carry control characters (and normalizes CR), so a spreadshe
_xHHHH_ are decoded back to the character they stand for. XML cannot carry
control characters (and normalizes CR), so a spreadsheet keeps them escaped — a cell holding a CR
is stored as _x000D_, and Excel as well as the sibling fast-excel-writer writes it that way.
The reader used to return the literal text _x000D_, so such a value did not survive a write/read
round trip. Text that literally reads _xHHHH_ is stored as _x005F_xHHHH_ and still comes back
unchanged; both forms are resolved in a single pass, so a decoded value is never decoded twice.
Requires avadim/fast-excel-helper 1.4 or above.Opening a workbook from a string or a stream. Excel::openString($content) reads a workbook held in memory (a database BLOB, an HTTP body, an S3/Flysys
Excel::openString($content) reads a workbook
held in memory (a database BLOB, an HTTP body, an S3/Flysystem read), and Excel::openStream($stream)
reads it from an open stream resource (a URL via fopen(), php://memory, a Flysystem read stream).
Both pick the reader by signature exactly like open(), so a string/stream carrying XLSX, XLS or CSV
reads back identically to the same file on disk, and both accept the same $options as open().
The content is copied to a temporary file (honouring Excel::setTempDir()), which is removed on
script shutdown; the stream passed to openStream() is not closed. See
docs/10-getting-started.md.Sheet::getHyperlinks() returns a sheet's hyperlinks keyed by the
cell (or range) they are anchored to, each as ['link' => ..., 'location' => ..., 'display' => ..., 'tooltip' => ...]. External targets are resolved from the sheet relationships file; internal links
expose their in-document location. A sheet without hyperlinks returns an empty array. See
docs/16-sheet-metadata.md.Excel::getProperties() returns the core
(docProps/core.xml) and application (docProps/app.xml) properties as one associative array with
normalised keys — creator, lastModifiedBy, created, modified, title, application,
company, ... Only the properties present in the file are returned; a workbook without a docProps
part returns an empty array. See docs/12-advanced-reading.md.An empty (zero-byte) file passed to Excel::open() now fails up front with a clear "File ... is empty" error, instead of being silently opened as a zer
Excel::open() now fails up front with a clear "File ... is empty" error, instead of being silently opened as a zero-row CSV — open() guesses the format by signature and an empty file matches none. Excel::openCsv() is unchanged and still reads an empty file as a valid, zero-row CSV.Reading CSV through `Excel::open()` — returns a one-sheet Csv\CsvBook exposing the same reading API as XLSX/XLS (key modes, read areas, withHeader(),
Excel::open() — returns a one-sheet Csv\CsvBook exposing the same reading API as XLSX/XLS (key modes, read areas, withHeader(), readColumns(), ...). Format is chosen by signature (OLE2 → XLS, ZIP → XLSX, otherwise CSV); pass Excel::open($file, $options) to configure the CSV reader or ['format' => 'csv'] to force it. openCsv() is unchanged and still returns the low-level Csv\CsvReader (also via CsvBook::getReader()). CSV has no styles/dates/merged cells/images — those accessors return empty results. See docs/20-csv.md.Excel::isXlsx() — ZIP-signature check (PK\x03\x04).allow_binary option (CsvOptions::setAllowBinary()) turns it off.Excel::open(string $file, $options = []) takes an optional second argument (BC-safe); a file that is neither OLE2 nor ZIP is now read as CSV instead of being pushed into the XLSX reader.CsvReader::rewind() now fully resets the read state, so re-reading after a partial pass no longer replays a stale buffer.Full bilingual changelog: CHANGELOG.md · CHANGELOG.ru.md
Excel::open(). open() now opens CSV files too, returning a Csv\CsvBook
— a normal one-sheet workbook that exposes the same AbstractSheet reading API (key modes, read
areas, withHeader(), readColumns(), ...) as XLSX and XLS. Format is chosen by signature (OLE2 →
XLS, ZIP → XLSX, otherwise CSV); pass Excel::open($file, $options) to configure the CSV reader or
force it with ['format' => 'csv']. Through open() the default column keys are Excel letters, for
parity with XLSX. openCsv() is unchanged and still returns the low-level Csv\CsvReader engine
(also reachable via CsvBook::getReader()). CSV carries no styles, number/date typing, merged cells
or images; those accessors return empty results instead of throwing. See docs/20-csv.md.Excel::isXlsx() — signature check (PK\x03\x04) telling a real XLSX/ZIP package apart from plain
text, which open() then reads as CSV.allow_binary option (CsvOptions::setAllowBinary()) turns the guard off.Excel::open(string $file, $options = []) takes an optional second argument (BC-safe). A file that
is neither an OLE2 nor a ZIP container is now read as CSV instead of being pushed into the XLSX
reader (where it used to fail) — a fix in behaviour for non-spreadsheet input.CsvReader::rewind() now fully resets the read state, so re-reading a file after a partial pass
no longer replays a stale buffer.Built-in date formats (numFmtId 14-22, such as the "short date" code 14) are now rendered deterministically. Previously the reader overwrote their pat
ext-intl was loaded, so the same file produced different strings depending on the
server locale and on whether the extension was installed (#53).
These codes now resolve to fixed patterns regardless of environment. Formats that a file spells
out explicitly are unaffected.useLocaleFormats(?string $locale = null) — opt in to locale-dependent rendering of the built-in
date codes (the previous behaviour, now explicit). Pass a locale for reproducible output, or nothing
to use the process default locale. Requires ext-intl.Full changelog: CHANGELOG.md · по-русски
XLS now reports formula text with the leading =, like XLSX always has. The f field of a formula cell has the same shape whichever format the file came
=, like XLSX always has. The f field of a formula
cell has the same shape whichever format the file came from, so code no longer needs to special-case
XLS. Formulas whose text cannot be recovered still report null, not "=".Full changelog: CHANGELOG.md · по-русски
Reading of legacy XLS workbooks (Excel 97-2003, BIFF8). Excel::open() now chooses the reader from the file signature, so XLSX and XLS are opened the s
Excel::open() now chooses the reader
from the file signature, so XLSX and XLS are opened the same way; the file extension is never
consulted. Excel::openXls() opens a workbook explicitly and Excel::isXls() exposes the test.
See docs/21-xls.md.
AbstractBook and AbstractSheet, holding the format-independent half of the readers: read areas,
key modes, result-mode flags, the row generator and every read* helper. XLSX and XLS share one
implementation of the whole public reading API.withHeader() now accepts an optional list of column names: withHeader(['name', 'birthday']). The
header row is still skipped, but the names come from the list instead of from its values. Names are
positional - the first name goes to the first column of the read area - so no column letters are
involved and the same call works on a sheet whose data does not start at A1. A shorter list renames
only the columns it covers. Supported for XLSX, XLS and CSV. Calling it with no argument is
unchanged. This mirrors the naming of writeHeader() in the sibling fast-excel-writer.Sheet::readCellsWithStylesFrom() returned bare cell values instead of values with styles: it called
readCells() rather than readCellsWithStyles(), and passed the style key into a bool parameter.Sheet::readCellsWithStyles($styleKey) never narrowed the result to the requested property. The key
was looked up on the nested style, where properties sit inside their group, so 'fill-color' - the
example in the method's own docblock - always returned the complete style instead.getCompleteStyleByIdx(), readCellsWithStyles() and everything built on
them - died with Call to undefined method DOMText::getAttribute() on workbooks whose styles.xml
is written with indentation, which several writers do.Sheet now return AbstractSheet, and the fluent setters on
the workbook return AbstractBook. The objects handed back are unchanged, and a subclass may still
narrow the return type back, so this only affects explicit type declarations in calling code.Full changelog: CHANGELOG.md · по-русски
Four defects in the sheet reading path, all in methods that had no test coverage.
Four defects in the sheet reading path, all in methods that had no test coverage.
Sheet::readFirstRowCellsFrom() always threw a TypeError. It forwarded $columnKeys into readFirstRowCells(?bool $styleIdxInclude), so even a default call failed. Because the result is keyed by cell address, column keys cannot apply at all — renaming a column would corrupt the address — so the parameter was dropped, mirroring readCellsFrom(). The new signature is readFirstRowCellsFrom(string $areaRange, ?bool $styleIdxInclude = null). No working call can break, since every call to the old signature threw.nulls. With a read area in place the row template was keyed by column letter while values were stored under numeric keys, and the values were then filtered out. Affected setReadArea() and setReadAreaColumns() combined with KEYS_COL_ZERO_BASED / KEYS_COL_ONE_BASED (and therefore KEYS_ZERO_BASED / KEYS_ONE_BASED). An explicit column name still takes precedence over the numeric key.Sheet::rewind() discarded its $columnKeys argument, although it is documented as an alias of reset().Sheet::firstCol() ignored the column bounds of the read area, reporting the first cell of the row as stored in the file. firstRow() was unaffected.The suite grows from 84 to 262 tests (357 to 757 assertions), added ahead of the fixes as a regression net:
read* method, the full KEYS_* matrix, result-mode flags, read areas, styles, dates, metadata and degenerate inputs, compared as whole arrays with assertSame.RESULT_MODE_ROW, TRIM_STRINGS, TREAT_EMPTY_STRING_AS_EMPTY_CELL and KEYS_RELATIVE had no coverage at all before and are now tested.Method coverage: Sheet 33.9% → 58.9%, Excel 55.6% → 69.4%.
<x:row>, <x:c>) still returns an empty result. This is a pre-existing limitation, now documented by a test rather than silently unnoticed.docs/ regenerated.Full changelog: https://github.com/aVadim483/fast-excel-reader/compare/v3.1.0...v3.2.0
Four defects, all in methods that had no test coverage.
Sheet::readFirstRowCellsFrom() always threw a TypeError: it forwarded $columnKeys into
readFirstRowCells(?bool $styleIdxInclude), so even a default call failed. Because the result is
keyed by cell address, column keys cannot apply, and the parameter was removed to match
readCellsFrom(). No working call can break, since every call to the old signature threw.nulls. With a read area in
place the row template was keyed by column letter while values were stored under numeric keys, and
the values were then filtered out. Affected setReadArea() and setReadAreaColumns() combined with
KEYS_COL_ZERO_BASED or KEYS_COL_ONE_BASED, and therefore also KEYS_ZERO_BASED and
KEYS_ONE_BASED.Sheet::rewind() discarded its $columnKeys argument although it is documented as an alias of
reset(): the body assigned to the parameter instead of forwarding it.Sheet::firstCol() ignored the column bounds of the read area, reporting the first cell of the row
as stored in the file. firstRow() was unaffected.read* method,
the full KEYS_* matrix, result-mode flags, read areas, styles, dates, metadata and degenerate
inputs, plus targeted tests for generator semantics, read areas, merged cells and streaming memory
behaviour. RESULT_MODE_ROW, TRIM_STRINGS, TREAT_EMPTY_STRING_AS_EMPTY_CELL and KEYS_RELATIVE
had no coverage at all before.<x:row>, <x:c>) read back as empty.Add stat() to Excel and Sheet, refactor countActualDimension() to str…
Add stat() to Excel and Sheet, refactor countActualDimension() to str…
…eaming
- Sheet::stat() returns rows/cols/cell counts in a single streaming pass,
cached in actualRows/actualCols/cellStat
- Excel::stat() aggregates per-sheet stats with workbook totals
- Rewrite countActualDimension() to a memory-bounded streaming scan that
glues tags across block boundaries and finds the last row via a tail window
- Document the full-scan cost in related methods' PHPDoc
- Add XlsxStatTest covering sheet/workbook stat and consistency with readCells
Nothing published for this version
Nothing published for this version
Nothing published for this version
Reading CSV files. More details in https://github.com/aVadim483/fast-excel-reader/blob/main/README-CSV.md
Reading CSV files. More details in https://github.com/aVadim483/fast-excel-reader/blob/main/README-CSV.md
IMPORTANT: Returns null for empty cells! Prior to version 2.30, it returned an empty string (not null).
IMPORTANT: Returns null for empty cells! Prior to version 2.30, it returned an empty string (not null).
Nothing published for this version
Nothing published for this version
Nothing published for this version
read files with non-alphabetic characters in the name (#, %, space, etc.)
read files with non-alphabetic characters in the name (#, %, space, etc.)
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
add: minRow(), maxRows(), minColumn(), maxColumn(); add: actualDimension(), countActualRows(), minActualRow(), maxActualRow(), countActualColumns(), m
add: minRow(), maxRows(), minColumn(), maxColumn(); add: actualDimension(), countActualRows(), minActualRow(), maxActualRow(), countActualColumns(), minActualColumn(), maxActualColumn()
improved handling of nonstandard files, thx @elchris
improved handling of nonstandard files, thx @elchris
Nothing published for this version
Nothing published for this version
New functions (thanks @HergenD):
New functions (thanks @HergenD):
getRowHeight(int $row): floatgetColumnWidth(int $col): floatgetFreezePaneInfo(): array (and alias getFreezePaneConfig())getTabColorInfo(): array (and alias getTabColorConfiguration()) This is used to determinte the background colors of sheet tabsNothing published for this version
Nothing published for this version
Nothing published for this version
PHP extension 'intl' is desirable but not required and this may affect the default date formatting.
PHP extension 'intl' is desirable but not required and this may affect the default date formatting.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Properly handle absolute paths in target attributes; (thanx @MiMatus) Saner handling of numeric values; (thanx @MiMatus) strftime() is no longer used
Properly handle absolute paths in target attributes; (thanx @MiMatus) Saner handling of numeric values; (thanx @MiMatus) strftime() is no longer used and ext-intl required for IntlDateFormatter
Nothing published for this version
Nothing published for this version
Nothing published for this version
Improved date/time type detection
Improved date/time type detection
Improved date and time handling
Improved date and time handling
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fix resolving shared string if the string is empty or equals to "0"; Fix error Undefined array key "col_keys"
Fix resolving shared string if the string is empty or equals to "0"; Fix error Undefined array key "col_keys"
One column per quarter.