PHPackages                             chillerlan/php-prototype-dom - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chillerlan/php-prototype-dom

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chillerlan/php-prototype-dom
============================

Prototype.js like DOM traversal and manipulation. PHP 7.4+

3.0.1(5y ago)0190↓66.7%1MITPHPPHP ^7.4 || ^8.0CI failing

Since May 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/chillerlan/php-prototype-dom)[ Packagist](https://packagist.org/packages/chillerlan/php-prototype-dom)[ Docs](https://github.com/chillerlan/php-prototype-dom)[ Fund](https://www.paypal.com/donate?hosted_button_id=WLYUNAT9ZTJZ4)[ Fund](https://ko-fi.com/codemasher)[ RSS](/packages/chillerlan-php-prototype-dom/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (1)

chillerlan/php-prototype-dom
============================

[](#chillerlanphp-prototype-dom)

[prototype.js](http://api.prototypejs.org/dom/) like DOM traversal and manipulation for PHP 7.4+.

[![PHP Version Support](https://camo.githubusercontent.com/404e9f84b51d0bd3e4a5e0e236967004aab5748b1da5c288ebbb47b4ab720449/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6368696c6c65726c616e2f7068702d70726f746f747970652d646f6d3f6c6f676f3d70687026636f6c6f723d383839324246)](https://www.php.net/supported-versions.php)[![version](https://camo.githubusercontent.com/e07f16d429778165be1144045b545711f380a9df681fa3a0bd270a64a535fa5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368696c6c65726c616e2f7068702d70726f746f747970652d646f6d2e7376673f6c6f676f3d7061636b6167697374)](https://packagist.org/packages/chillerlan/php-prototype-dom)[![license](https://camo.githubusercontent.com/44fb34eca91e49b65f90ef730a43dcc37fcbca2eb4926049feead286cc764a1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6368696c6c65726c616e2f7068702d70726f746f747970652d646f6d2e737667)](https://github.com/chillerlan/php-prototype-dom/blob/main/LICENSE)[![Travis](https://camo.githubusercontent.com/ecf4f33bfbf0e59896df3eede3880796458ee393082a4f8822716b6077fdc8f6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6368696c6c65726c616e2f7068702d70726f746f747970652d646f6d2f6d61696e2e7376673f6c6f676f3d747261766973)](https://travis-ci.com/github/chillerlan/php-prototype-dom)[![Coverage](https://camo.githubusercontent.com/600f92ec3fb15a0f64535c11f3e8b9adc2eb6aaf8204fd4112d56d330a0143df/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6368696c6c65726c616e2f7068702d70726f746f747970652d646f6d2e7376673f6c6f676f3d636f6465636f76)](https://codecov.io/github/chillerlan/php-prototype-dom)[![Scrunitizer](https://camo.githubusercontent.com/e73bd961a390a5ad79750ea9c6db86194e354ed7e178d1b07a2a2f506f2b4b64/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6368696c6c65726c616e2f7068702d70726f746f747970652d646f6d2e7376673f6c6f676f3d7363727574696e697a6572)](https://scrutinizer-ci.com/g/chillerlan/php-prototype-dom)[![Packagist downloads](https://camo.githubusercontent.com/e3d1035d103b4104a00c1bd491e2b2d88cffe4169bd1c379f8fdb558ab62e46d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368696c6c65726c616e2f7068702d70726f746f747970652d646f6d2e7376673f6c6f676f3d7061636b6167697374)](https://packagist.org/packages/chillerlan/php-prototype-dom/stats)
[![CI](https://github.com/chillerlan/php-prototype-dom/workflows/CI/badge.svg)](https://github.com/chillerlan/php-prototype-dom/actions?query=workflow%3A%22CI%22)[![phpDocs](https://github.com/chillerlan/php-prototype-dom/workflows/Docs/badge.svg)](https://github.com/chillerlan/php-prototype-dom/actions?query=workflow%3ADocs)

Documentation
=============

[](#documentation)

An API documentation created with [phpDocumentor](https://www.phpdoc.org/) can be found at  (WIP).

- for the extended `DOMNode` (prototypejs) methods see: [`Element.Methods`](http://api.prototypejs.org/dom/Element/Methods/)
- for the extended `DOMNodeList` methods see [`Enumerable`](http://api.prototypejs.org/language/Enumerable/)
- for the CSS selector capabilities of the several selction methods see the [`Symfony CssSelector Component`](https://symfony.com/doc/current/components/css_selector.html) documentation

Requirements
------------

[](#requirements)

- PHP 7.4+
    - the [`DOM`](https://www.php.net/manual/book.dom.php) and [`libXML`](https://www.php.net/manual/de/book.libxml.php) extensions

Installation
------------

[](#installation)

**requires [composer](https://getcomposer.org)**

`composer.json` (note: replace `dev-main` with a [version boundary](https://getcomposer.org/doc/articles/versions.md))

```
{
	"require": {
		"php": "^7.4 || ^8.0",
		"chillerlan/php-prototype-dom": "dev-main"
	}
}
```

Profit!

Quickstart
----------

[](#quickstart)

```
use chillerlan\PrototypeDOM\Document;
use chillerlan\PrototypeDOM\Node\PrototypeHTMLElement;

$document = new Document(file_get_contents('https://www.php.net/supported-versions.php'));

$supportedVersions = $document->querySelectorAll('tr.stable > td:first-of-type > a')
	->map(fn(PrototypeHTMLElement $a):string => $a->value());

var_dump($supportedVersions); // -> ['7.4', '8.0']
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~202 days

Recently: every ~296 days

Total

8

Last Release

1921d ago

Major Versions

1.0.4 → 2.0.02019-11-12

2.0.0 → 3.0.02021-03-27

PHP version history (3 changes)1.0.0PHP &gt;=7.0.3

2.0.0PHP ^7.2

3.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/592497?v=4)[smiley](/maintainers/codemasher)[@codemasher](https://github.com/codemasher)

---

Top Contributors

[![codemasher](https://avatars.githubusercontent.com/u/592497?v=4)](https://github.com/codemasher "codemasher (76 commits)")

---

Tags

domphpphp-libraryphp7php8prototypejstraversal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chillerlan-php-prototype-dom/health.svg)

```
[![Health](https://phpackages.com/badges/chillerlan-php-prototype-dom/health.svg)](https://phpackages.com/packages/chillerlan-php-prototype-dom)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513381.2k11](/packages/spatie-laravel-pjax)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49517.1k](/packages/blackfire-player)[dominikb/composer-license-checker

Utility to check for licenses of dependencies and block/allow them.

574.3M12](/packages/dominikb-composer-license-checker)[fusonic/opengraph

PHP library for consuming and publishing Open Graph resources.

104391.1k5](/packages/fusonic-opengraph)[crwlr/crawler

Web crawling and scraping library.

36816.4k2](/packages/crwlr-crawler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
