NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #2534 most downloaded on Packagist
PHP library for HTML(5)/XML querying (CSS 4 or XPath) and processing (like jQuery) with PHP 7.0 to 8.5 support
Last release 6 months ago
17 Mar 2026
Release timing varies
gaps range from 3 months to 3.7 years
Nearly every release is documented
notes for 19 of 20 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
23 releases · first in 2012
PHP 8.5 support by @jakejackson1 in #64
Mark as PHP 8.4 compatible by @jakejackson1 in #59
Full Changelog: 4.0.1...4.1.0
One column per quarter.
\QueryPath\CSS\DOMTraverser\Util::parseAnB() in \QueryPath\CSS\QueryPathEventHandler class to parse the :nth-child(an+b) syntax\QueryPath\CSS\QueryPathEventHandler::parseAnB() in favor of public static method \QueryPath\CSS\DOMTraverser\Util::parseAnB()Only define global functions qp(), htmlqp(), and html5qp() if they haven't already been defined by @jakejackson1 in #53
Full Changelog: 4.0.0...4.0.1
Reverse logic of html5() Method by @jakejackson1 in #43
Full Changelog: 3.2.3...4.0.0
Fix type mismatch for classes that implement the "Query" interface
PHP 8.2 Support by @jakejackson1 in #26
Full Changelog: 3.2.1...3.2.2
Resolve PHP8.1 Deprecation Notice by @jakejackson1 in #32
Full Changelog: 3.2.0...3.2.1
The library was forked from https://github.com/arthurkushman/querypath , which was forked from https://github.com/technosophos/querypath .
The library was forked from https://github.com/arthurkushman/querypath, which was forked from https://github.com/technosophos/querypath.
>=7.1 to ^7.1 || ~8.0.0 || ~8.1.0 so developers are explicitly aware which PHP versions are supported by the librarymaster branch to mainFull Changes: 3.1.4...3.2.0
Added return types to getIterator() and count() for compatibility with PHP 8.1
#8 . Add DOMQuery traits - dividing mutators, filters, checks
#8. Add DOMQuery traits - dividing mutators, filters, checks
Add format extension + test coverage + readme
Fix juggling equations, return types in Utils
Transform library for PHP>=7.1 support + essential bug-fixes
Transform library for PHP>=7.1 support + essential bug-fixes
Nothing published for this version
Addition of namespace fetching method ns().
Bug #141: Fixed :gt and :lt pseudoclasses (thanks to lsv)
Bug #112: children() was not correctly restricting filters.
Issue #100: qp.php divided into qp.php and qp_functions.php. Composer now includes qp(). (via hakre)
THAT MEANS: find() now works like jQuery find(), branch() is deprecated. findInPlace() does what find() used to do.
REALLY IMPORTANT CHANGE: To match jQuery, and to correctly implement a bottom-up parser, the following will no longer work: $qp($html, 'li')->find(':root ul'); You can no longer use find() to ever, ever move UP the document true (like back to the root from somewhere in the tree). You MUST use top() to do this now. This is how jQuery works, and making this minor change makes things much faster.
REALLY IMPORTANT CHANGE: Many "destructive" operations now return a new QueryPath object. This mirrors jQuery's behavior.
THAT MEANS: find() now works like jQuery find(), branch() is deprecated. findInPlace() does what find() used to do.
removeAll() now works as it does in recent jQuery. Thanks to GDMac (issues #77 #78) for the fix.
Refactored to use namespaces.
Refactored to be SPR-0 compliant.
Now uses Composer.
The traversal mechanism is now bottom-up, which means Querypath is faster.
Issue #83: Fixed broken forloop in techniques.php. Thanks to BillOrtell for the fix.
ID-based searches no longer guarantee that only one element will be returned. This accomodates XML documents that may use 'id' in a way different than HTML.
The base CSS Traverser is now optimized for selectors that use ID or class, but no element.
Pseudo-element behavior has been rewritten to better conform to the standard. Using a pseudo-element no longer changes the match. Rather, it checks to see if the condition is met by the present element, and returns TRUE if it does. This means we do not need special case logic to deal with text fragments.
:x-root, :x-reset, and :scope are now implemented using the same algorithm (they are, in other words, aliases). Since :scope is part of CSS 4, you should use that.
Support for the following CSS 4 Selectors featues has been added:
Traversing UP the DOM tree with find() is no longer allowed. Use top().
:first is an alias of :nth(1) instead of :first-of-type. This follows jQuery now.
eachLambda() is now deprecated. It WILL be removed in the future.
Extensions: QPList, QPTPL, and QPDB have all been moved to the new project QueryPath-Ext.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixed the case where remove() caused an error when no items were found to remove (issue #63). Thanks marktheunissen for the bug report and fix.
Your coding agent can read these notes before it upgrades. Set up the MCP server →