PHPackages                             pyrsmk/php-class - 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. pyrsmk/php-class

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

pyrsmk/php-class
================

PHP class loader

1.0.0(7y ago)176MITPHPPHP &gt;=7.2.0

Since Mar 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/pyrsmk/PhpClass)[ Packagist](https://packagist.org/packages/pyrsmk/php-class)[ RSS](/packages/pyrsmk-php-class/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PhpClass
========

[](#phpclass)

PhpClass is a PHP class loader that allows you to load and instantiate class files on-the-fly. It was created to be able to load classes which names cannot be known before runtime, as [ReflectionClass](http://php.net/manual/en/class.reflectionclass.php) do not support loading from files.

Installing
----------

[](#installing)

```
composer require pyrsmk/php-class

```

Use
---

[](#use)

```
$phpClass = new PhpClass('path/to/a/file.php');
$myObject = $phpClass->instantiate();
```

If needed, you can retrieve the namespace and the class name from the file without instantiating it :

```
$phpClass = new PhpClass('path/to/a/file.php');
echo $phpClass->namespace();
echo $phpClass->classname();
```

License
-------

[](#license)

Released under [MIT license](http://dreamysource.mit-license.org).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

2632d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f97d81cfd6d30587cdae24925bc0899331394d723d04ee4b76eb9435a565fe9?d=identicon)[pyrsmk](/maintainers/pyrsmk)

---

Tags

loaderclassclassesloadingload

### Embed Badge

![Health badge](/badges/pyrsmk-php-class/health.svg)

```
[![Health](https://phpackages.com/badges/pyrsmk-php-class/health.svg)](https://phpackages.com/packages/pyrsmk-php-class)
```

###  Alternatives

[nette/robot-loader

🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.

89152.7M321](/packages/nette-robot-loader)[classpreloader/classpreloader

Helps class loading performance by generating a single PHP file containing all of the autoloaded files for a specific use case

37642.4M32](/packages/classpreloader-classpreloader)[lorisleiva/lody

Load files and classes as lazy collections in Laravel.

956.6M9](/packages/lorisleiva-lody)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

374468.4k51](/packages/flow-php-etl)[m1/env

Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.

6412.0M21](/packages/m1-env)

PHPackages © 2026

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