zendframework/zend-dom
Zend\Dom provides tools for parsing and querying HTML and XML documents, including CSS selector support translated to XPath via Zend\Dom\Query. A legacy Zend Framework component for DOM inspection and extraction.
table#invoice-lines") and an engineer implement it in a handful of lines rather than hand-rolling XPath.ext-dom that adds CSS-selector translation. Writing that yourself is roughly a day of work and a permanent maintenance tax. The decision isn't "is this worth money" (it's BSD-3, free) — it's "which of three near-equivalents do we standardize on": this (archived), laminas/laminas-dom (the maintained successor), or symfony/dom-crawler (broader, actively maintained, heavier).Read on the scores: high opportunity/completeness with 29 stars and a 2019 release is the signature of "stable and finished," not "gaining traction." Score it as maturity, not momentum.
Adopt (or, more likely, tolerate) when:
Look elsewhere when:
laminas/laminas-dom — same lineage, maintained, the intended successor. Choosing the Zend-namespaced artifact for new code is choosing a migration you'll schedule later for no benefit today.masterminds/html5 (optionally with symfony/dom-crawler) handles it, this era of tooling is more XML-strict.Migration cost, for planning: low. The API surface is narrow; a swap to Laminas is typically small, and a swap to Symfony DomCrawler is a contained refactor if you've kept queries in one place.
To executives: This is a commodity parsing utility — no license cost, no vendor relationship, no revenue line. Its value is measured in engineer-days not spent writing XPath by hand. The genuine risk is staleness: it's an archived component with no one shipping fixes. That risk is acceptable only because it's a small, isolated, replaceable piece; the mitigation is a one-to-two-day swap to the maintained fork if it ever becomes load-bearing. Recommendation: don't invest in it, don't fear it — standardize on the maintained successor for anything new, and leave existing usage alone until it's convenient to move it.
To engineering: Narrow scope, does one thing well — query a DOM with CSS selectors over ext-dom/XPath. Expect it to work; expect zero fixes. Before adopting, run a short spike to confirm behavior on your PHP version, since the last release predates current runtimes. Wrap it behind your own thin query/parse interface so a swap to Laminas or Symfony is a one-file change rather than a hunt. Keep it out of request paths that parse third-party HTML.
To the security/data team: It parses untrusted markup with an unmaintained parser. That's fine for offline jobs on data you already trust; it is not fine for user-supplied HTML in a live path. Flag the distinction explicitly rather than arguing about the package as a whole.
Framing tip: Lead with "this is finished, not thriving." The high completeness score invites the wrong conclusion; the correct read is that the code is mature and the project is closed. That reframes the conversation from "should we bet on this?" to "how cheaply can we route around it?" — which is the decision that actually needs a yes.
How can I help you explore Laravel packages today?