PackageTrack
Sign in Get early access

gravitypdf/querypath

PHP library for HTML(5)/XML querying (CSS 4 or XPath) and processing (like jQuery) with PHP 7.0 to 8.5 support

4.2.0 1.7M downloads/mo #2313 most downloaded on Packagist GravityPDF/querypath

What this package is like to depend on

Last release 5 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

1 release in the last 12 months

see the full history below

Release timeline

23 releases · Feb 2012 to Mar 2026
2013 2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 23
  1. 4.2.0 17 Mar 2026
    Release notes

    What's Changed

    Full Changelog: 4.1.0...4.2.0

    Open source →
  2. 4.1.0 04 Feb 2025
    Release notes

    What's Changed

    Full Changelog: 4.0.1...4.1.0

    Open source →
    Release notes
    • Update composer.json to mark library as PHP 8.4 compatible
    • Use \QueryPath\CSS\DOMTraverser\Util::parseAnB() in \QueryPath\CSS\QueryPathEventHandler class to parse the :nth-child(an+b) syntax
    • Deprecate protected method \QueryPath\CSS\QueryPathEventHandler::parseAnB() in favor of public static method \QueryPath\CSS\DOMTraverser\Util::parseAnB()
    Open source →
  3. 4.0.1 07 Nov 2024
    Release notes

    What's Changed

    • Only define global functions qp(), htmlqp(), and html5qp() if they haven't already been defined by @jakejackson1 in #53
    • Fix for :nth-child(n+B) to select B-th and all following elements by @super-dm3 in #56

    New Contributors

    Full Changelog: 4.0.0...4.0.1

    Open source →
    Release notes
    • Only define global functions qp(), htmlqp(), and html5qp() if they haven't been defined already.
    • Fix for :nth-child(n+B) to select B-th and all following elements
    • Fix for :nth-child(-n+B) to select first B elements
    • Update PHPUnit Test Suite to use @dataProvider in testPseudoClassNthChild() to reduce code repetition
    • Fix error when getting parents() for HTML elements
    Open source →
  4. 4.0.0 12 Aug 2024
    Release notes

    What's Changed

    Full Changelog: 3.2.3...4.0.0

    Open source →
    Release notes
    • Reverse logic in DomQuery::html5() so that DomQuery::html5() returns the content of the current match, and DomQuery::html5('') replaces the content of the current matches. This matches the existing logic used in DomQuery::html().
    • Return DOMQuery object if QueryMutators::wrapAll() has no matches (instead of null). This aligns the method with the Docblock return type.
    Open source →
  5. 3.2.3 01 Dec 2023
    Release notes
    • Add PHP 8.3 Support
    • Fix type mismatch for classes that implement the "Query" interface
    Open source →
  6. 3.2.2 11 Dec 2022
    Release notes

    What's Changed

    Full Changelog: 3.2.1...3.2.2

    Open source →
    Release notes
    • Add PHP 8.2 Support
    Open source →
  7. 3.2.1 08 Dec 2022
    Release notes

    What's Changed

    Full Changelog: 3.2.0...3.2.1

    Open source →
    Release notes
    • Fix QueryPath\QueryPathIterator::current() deprecation notice in PHP8.1
    Open source →
  8. 3.2.0 07 Dec 2022
    Release notes

    What's Changed

    The library was forked from https://github.com/arthurkushman/querypath, which was forked from https://github.com/technosophos/querypath.

    Bug Fixes

    • Fixes a number of type-related errors on PHP 8.1

    Documentation and Maintenance

    Full Changes: 3.1.4...3.2.0

    Open source →
    Release notes
    • Fixes a number of type-related errors on PHP 8.1
    • Update PHPUnit Test Suite to pass from PHP7.1 to 8.1
    • Add GitHub Actions to run PHPUnit for all PRs
    • Removes composer.lock file to ensure the correct PHPUnit is installed in GitHub Actions. Since this is a library this is generally the accepted practice.
    • Removed the Faker dependency (it didn't appear to be used in the codebase and has been sunset).
    • Apply PSR-2 Linter to Codebase, using tabs instead of spaces
    • Rename QueryPath fork and prepare for publishing on Packagist
    Open source →
  9. 3.1.4 28 Mar 2022
    Release notes
    • Added return types to getIterator() and count() for compatibility with PHP 8.1
    Open source →
  10. 3.1.3 05 Aug 2018
    Release notes

    #8. Add DOMQuery traits - dividing mutators, filters, checks

    Open source →
    Release notes
    • Add DOMQuery traits - dividing mutators, filters, checks
    Open source →
  11. 3.1.2 04 Aug 2018
    Release notes
    • Add format extension + test coverage + readme
    Open source →
  12. 3.1.1 03 Aug 2018
    Release notes
    • Fix juggling equations, return types in Utils
    Open source →
  13. 3.1.0 02 Aug 2018
    Release notes

    Transform library for PHP>=7.1 support + essential bug-fixes

    • Add strict types passed for parameters
    • Add return types scalar/boxed
    • Refactor code to OOP (DRY/KISS/SOLID/YAGNI) style - minor to be continued...
    • Remove redundant code
    • Remove redundant ops
    • Fix bugs with equations
    • Fix juggling equations
    • Fix priority ops in flow structs
    • Remove unused vars from stack
    Open source →
  14. 3.0.5 01 Aug 2016

    Nothing published for this version

  15. 3.0.4 10 Oct 2015
    Release notes
    • Addition of namespace fetching method ns().
    • Various fixes
    • Basic support for HTML5 via Masterminds\HTML5
    • Fixed #164
    Open source →
  16. 3.0.3 23 Sep 2014
    Release notes
    • Bug #141: Fixed :gt and :lt pseudoclasses (thanks to lsv)
    • Bug #124: Fixed inheritance issue with late static binding (via noisan)
    • Bug #126: text(string) was not updating all matched elements (via noisan)
    • Bug #127: wrapInner() was mangling the HTML if matched element set was greater than 1 (via noisan)
    • Bug #128: Improved jQuery compatibility with wrap*() *pend(), before(), after(), etc. (via noisan)
    Open source →
  17. 3.0.2 24 May 2013
    Release notes
    • Bug #112: children() was not correctly restricting filters.
    • Bug #108: QueryPath\Query interface was too restrictive. (via mkalkbrenner)
    • Feature #106: :contains() is now case-insensitive. (via katzwebservices)
    Open source →
  18. 3.0.1 08 Mar 2013
    Release notes
    • Issue #100: qp.php divided into qp.php and qp_functions.php. Composer now includes qp(). (via hakre)
    • Issue #102: Added QueryPath.VERSION_MAJOR, changed QueryPath.VERSION
    • Issue #97: Rewrite children() and filter() to be a little more efficient.
    Open source →
  19. 3.0.0 11 Dec 2012
    Release notes
    • 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:

      • :matches() pseudoclass, which behaves the way :has() behaves.
      • :any-link
      • :local-link (with some restrictions, as it does not know what the real URL of the document is).
      • :scope (see above)
    • 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.

    Open source →
  20. 3.0.0-alpha3 01 Sep 2012 pre-release

    Nothing published for this version

  21. 3.0.0-alpha2 25 Jun 2012 pre-release

    Nothing published for this version

  22. 3.0.0-alpha1 01 Jun 2012 pre-release

    Nothing published for this version

  23. 2.1.2 03 Feb 2012
    Release notes
    • 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.
    • New XML extensions to deal with adding namespaced elements (#64). Thanks to theshadow for contributing an entire extension, and to farinspace for detailed experiments with QP and XML namespaces.
    • The adjacent CSS selector has been modified to ignore text elements. This seems to be inline with the spec, but I am not 100% sure. Thanks to fiveminuteargument for the patch.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive