PHPackages                             wuding/php-func - 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. wuding/php-func

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

wuding/php-func
===============

PHP function polyfill

21.2.22(5y ago)41432BSD-3-ClausePHPPHP &gt;=5.4.0

Since Feb 21Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/wuding/php-func)[ Packagist](https://packagist.org/packages/wuding/php-func)[ RSS](/packages/wuding-php-func/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (4)DependenciesVersions (13)Used By (2)

php-func
========

[](#php-func)

PHP 通用函数库及别名定义，按需加载

Install
-------

[](#install)

```
composer require wuding/php-func
```

Usage
-----

[](#usage)

### func

[](#func)

func - 定义函数别名

#### 说明

[](#说明)

```
func ( mixed $function_config [, array $alias_classes = array() [ , mixed $... ]] ) : void
```

单独或批量定义函数别名，并预设参数默认值

#### 参数

[](#参数)

**function\_config**

要调用或声明的原始函数（名），也可以是批量配置

**alias\_classes**

要定义的函数别名或依赖哪些类

**...**

函数的参数

#### 范例

[](#范例)

bootstrap.php

```
$Composer = require APP_PATH . '/../vendor/autoload.php';

$functions = [
    '_isset' => ['', [], '', null],
    '\Func\array_diff_kv' => ['', [], [], [], false],
    '\Func\Arr::diff' => ['\Func\diff', [], [], [], false],
    'str_match' => ['', '//', '', null, false],
    'wtf' => [function ($text) { return $text; }, 'hi'],
];

func($functions, ['Variable', 'Arr', 'PCRE']);
func('\Func\Str\unicode_decode', '', [], [], [], false);
new \Func\Alias('test', function ($text) { return $text; }, 'test');

echo str_match('/^\d+元/', '3元', '1角', true);
echo unicode_decode('\u65b0\u6d6a\u5fae\u535a', 'json');
echo test('str');
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

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 ~81 days

Recently: every ~56 days

Total

10

Last Release

1908d ago

Major Versions

v1.0.4 → 20.192.16552020-07-10

20.200.524 → 21.1.192021-01-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fbd1feb71a5d5f22f7ef5bd41bbe94e8076d948b769f0a9b835a1e8ded22b7a?d=identicon)[wuding](/maintainers/wuding)

---

Top Contributors

[![wuding](https://avatars.githubusercontent.com/u/235209?v=4)](https://github.com/wuding "wuding (36 commits)")

---

Tags

polyfillshimfunction

### Embed Badge

![Health badge](/badges/wuding-php-func/health.svg)

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

###  Alternatives

[symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

7.8k1.2B515](/packages/symfony-polyfill-mbstring)[symfony/polyfill-php72

Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions

4.8k674.7M31](/packages/symfony-polyfill-php72)[symfony/polyfill-intl-idn

Symfony polyfill for intl's idn\_to\_ascii and idn\_to\_utf8 functions

3.4k774.6M90](/packages/symfony-polyfill-intl-idn)[symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

2.1k830.2M36](/packages/symfony-polyfill-intl-normalizer)[symfony/polyfill-php73

Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions

2.4k581.8M67](/packages/symfony-polyfill-php73)[symfony/polyfill-php80

Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions

1.7k815.2M457](/packages/symfony-polyfill-php80)

PHPackages © 2026

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