Releases: fivefilters/readability.php
Release list
v4.0.0 - 18 July 2026
What's Changed
Readability.php 4.0 is a ground-up rewrite: a fresh port of Mozilla's Readability.js v0.6.0 built on PHP 8.4's new DOM API and HTML parser. This is the first stable release of the 4.0 series and includes everything from v4.0.0-beta.1.
Highlights
- PHP 8.4+ with native WHATWG parsing — parsing and serialization use
Dom\HTMLDocument(the spec-compliant Lexbor parser bundled with PHP), replacing HTML5-PHP and the legacy libxml path. No more entity workarounds (substituteEntities,summonCthulhuand friends are gone). - Parity with Readability.js 0.6.0 — including
langandpublishedTimeoutput,maxElemsToParse,classesToPreserve,allowedVideoRegex,linkDensityModifieranddebugoptions, andReaderable::isProbablyReaderable(). - New result API —
parse()returns a readonlyArticlevalue object (title,content,textContent,excerpt,byline,siteName,dir,lang,publishedTime,image,images, …). Options are passed as named constructor arguments:new Readability(fixRelativeURLs: true). - Real WHATWG URL resolution — relative URLs are fixed using PHP 8.5's native
Uri\WhatWg\Urlwhen available, with rowbot/url as the fallback on PHP 8.4, matching thenew URL()behavior Readability.js relies on. - Tested against Mozilla's own corpus — the test suite runs Mozilla's 130 test pages verbatim, with their structural DOM comparison ported to PHP.
- Broader dependency compatibility — constraints widened to
psr/log ^1.0 || ^2.0 || ^3.0androwbot/url ^3.1.7 || ^4.0so the library co-installs cleanly alongside a wider range of applications, with CI now also testing the lowest allowed versions (#49).
Upgrading from 3.x
The API has changed — see UPGRADE.md for the full migration guide, and the CHANGELOG for the complete list of changes.
Upgrading from v4.0.0-beta.1
The only changes since beta.1 are the widened dependency constraints and lowest-deps CI coverage noted above — no code changes.
Full Changelog: v3.3.3...v4.0.0
v4.0.0-beta.1 - 16 July 2026
What's Changed
- v4.0: Rewrite on PHP 8.4's native DOM API, parity with Readability.js 0.6.0 by @fivefilters in #41
- Test corpus is Mozilla's own 130 test pages, verbatim
- See the CHANGELOG for full details and UPGRADE.md for the 3.x → 4.0 migration guide.
Full Changelog: v3.3.3...v4.0.0-beta.1
v3.3.3 - 27 April 2025
Fix type error - extends type support to add DOMProcessingInstruction in more method signatures (reported in
#39 by @reinierkors)
Full Changelog: v3.3.2...v3.3.3
v3.3.2 - 7 March 2025
Fix type error - extends type support to include DOMCdataSection and DOMProcessingInstruction in various method signatures (reported in
#37 and #38 by @mikiescolarmrf and @Grotax)
Full Changelog: v3.3.1...v3.3.2
v3.3.1 - 14 January 2025
What's Changed
Full Changelog: v3.3.0...v3.3.1
v3.3.0 - 29 November 2024
- Fixed PHP 8.4 deprecation warning #31 (reported by @pich)
- Migrated type declarations from PHPDoc blocks to native PHP 8 property and method types
- Empty class attributes now removed when
keepClassesis disabled - Replaced legacy DOM operations with native PHP 8 methods:
isWhitespaceInElementContent()for whitespace detectionfirstElementChildandpreviousElementSiblingfor DOM traversal
- Updated Docker test environment to support PHP 8.1-8.4
Full Changelog: v3.2.0...v3.3.0
v3.2.0 - 21 April 2024
- Update dependencies to newer versions (League/URI version 7) to improve compatibility with projects already relying on those versions
- Minimum PHP version set to 8.1 (required by League/URI 7)
- Update Docker tests to use PHP 8.1, 8.2 and 8.3
Full Changelog: v3.1.7...v3.2.0
v3.1.7 - 21 April 2024
- Fixes URL syntax errors when bad URLs are encountered when rewriting relative URLs - reported by @marcelklehr
- Fixes PHP 8 deprecation notice when base URLs (used for rewriting relative URLs) don't have a path component - thanks to @blat and @Markus-GS
Full Changelog: v3.1.6...v3.1.7
v3.1.6 - 15 June 2023
What's Changed
- Avoid re-parsing source HTML when making multiple attempts to identify content in parse()
Full Changelog: v3.1.5...v3.1.6
v3.1.5 - 6 April 2023
What's Changed
- Allow psr/log version 2.x and 3.x - thanks to @piotrek-r and @arondeparon
- Fix GitHub actions for tests - thanks to @arondeparon
Full Changelog: v3.1.4...v3.1.5