PHPackages                             ajf/php4\_constructor\_finder - 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. ajf/php4\_constructor\_finder

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

ajf/php4\_constructor\_finder
=============================

Finds PHP4-style constructors

1.0(11y ago)2372[1 issues](https://github.com/TazeTSchnitzel/PHP4_Constructor_Finder/issues)[1 PRs](https://github.com/TazeTSchnitzel/PHP4_Constructor_Finder/pulls)MITPHP

Since Nov 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/TazeTSchnitzel/PHP4_Constructor_Finder)[ Packagist](https://packagist.org/packages/ajf/php4_constructor_finder)[ Docs](https://github.com/TazeTSchnitzel/PHP4_Constructor_Finder)[ RSS](/packages/ajf-php4-constructor-finder/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (2)Used By (0)

PHP 4 Constructor Finder
========================

[](#php-4-constructor-finder)

Name says it all. It's a tiny little PHP script that uses Nikita Popov's [PHP-Parser](https://github.com/nikic/PHP-Parser) to find PHP 4 constructors.

What are PHP 4 constructors? These:

```
class Bar {
    public function Bar() {
    }
}

```

If you didn't know (oh dear god), the modern way to make a constructor is `public function __construct()` - but for backwards-compatibility, we keep around this thing where a function with the same name of the class is magically a constructor. Yuck.

This is a problem, because what if you make a class called `Filter` with a method called `filter`? Uh-oh.

So, Levi Morrison [wrote an RFC to get rid of this](https://wiki.php.net/rfc/remove_php4_constructors), and I wrote this at his request. It finds PHP4 constructors. That's it, really.

Installation and Usage
----------------------

[](#installation-and-usage)

For development, `composer install` in the checked-out repo. For normal use, `composer install -g ajf/PHP4_Constructor_Finder`.

Command line usage is `finder file1.php file2.php ...`.

Run the tests with `vendor/bin/phpunit --bootstrap vendor/autoload.php src/tests.php`.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

4246d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/724611fb49c94fab145b2965f6014caae9bee4620227fe1bdf3a4e353a0f23a9?d=identicon)[ajf](/maintainers/ajf)

---

Top Contributors

[![hikari-no-yume](https://avatars.githubusercontent.com/u/579774?v=4)](https://github.com/hikari-no-yume "hikari-no-yume (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ajf-php4-constructor-finder/health.svg)

```
[![Health](https://phpackages.com/badges/ajf-php4-constructor-finder/health.svg)](https://phpackages.com/packages/ajf-php4-constructor-finder)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M118](/packages/deptrac-deptrac)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

6003.7M103](/packages/roave-backward-compatibility-check)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4814.0M25](/packages/coenjacobs-mozart)[v.chetkov/php-clean-architecture

PHP Clean Architecture

14661.1k](/packages/vchetkov-php-clean-architecture)

PHPackages © 2026

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