PHPackages                             zhusaidong/php-class-method-exists - 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. zhusaidong/php-class-method-exists

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

zhusaidong/php-class-method-exists
==================================

php class-method-exists

012PHP

Since Jun 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/zhusaidong/php-class-method-exists)[ Packagist](https://packagist.org/packages/zhusaidong/php-class-method-exists)[ RSS](/packages/zhusaidong-php-class-method-exists/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

php-class-method-exists
=======================

[](#php-class-method-exists)

php class-method-exists

Introduction
------------

[](#introduction)

> php 动态调用类和方法时，需要2步：先`class_exists`，再`method_exists`。

> 该组件将这2步合二为一。

Usage
-----

[](#usage)

```
composer require zhusaidong/php-class-method-exists:dev-master
```

```
require('../vendor/autoload.php');
//demo class
class foo
{
	public function public_fun(){}
	private function private_fun(){}
}
//test foo1::public_fun
if(!ClassMethodExists::class_method_exists('foo1','public_fun'))
{
	var_dump("foo1::public_fun",ClassMethodExists::errmsg());
}
//test foo::private_fun
if(!ClassMethodExists::class_method_exists('foo','private_fun'))
{
	var_dump("foo::private_fun",ClassMethodExists::errmsg());
}
//test foo::public_fun
if(!ClassMethodExists::class_method_exists('foo','public_fun'))
{
	var_dump("foo::public_fun",ClassMethodExists::errmsg());
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c2e985c6870cd488335da55e8b435d590dc8f887ba795af4f818c18b650c888?d=identicon)[zhusaidong](/maintainers/zhusaidong)

---

Top Contributors

[![zhusaidong](https://avatars.githubusercontent.com/u/3039961?v=4)](https://github.com/zhusaidong "zhusaidong (6 commits)")

### Embed Badge

![Health badge](/badges/zhusaidong-php-class-method-exists/health.svg)

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

###  Alternatives

[bigwhoop/sentence-breaker

Sentence boundary disambiguation (SBD) - or sentence breaking - library written in PHP.

42132.3k](/packages/bigwhoop-sentence-breaker)[j0k3r/graby-site-config

Graby site config files

23365.8k3](/packages/j0k3r-graby-site-config)

PHPackages © 2026

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