PHPackages                             arshidkv12/traitify - 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. arshidkv12/traitify

ActivePhp-ext[Utility &amp; Helpers](/categories/utility)

arshidkv12/traitify
===================

Traitify is a native PHP extension that provides commonly used traits

v1.0.0(9mo ago)591[1 issues](https://github.com/arshidkv12/traitify/issues)PHP-3.01CPHP &gt;=8.0,&lt;8.6CI failing

Since Aug 9Pushed 9mo agoCompare

[ Source](https://github.com/arshidkv12/traitify)[ Packagist](https://packagist.org/packages/arshidkv12/traitify)[ RSS](/packages/arshidkv12-traitify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Traitify PHP Extension
======================

[](#traitify-php-extension)

**Traitify** is a native PHP extension that provides commonly used traits such as `Singleton`, implemented in C for optimal performance and better memory efficiency.

---

🧩 Features
----------

[](#-features)

- ✅ Native `Traitify\Singleton` trait
- ✅ Automatic singleton management (`getInstance()`)
- ✅ Proper support for `__construct()`
- 🚀 Built for speed — skips PHP overhead
- 🧠 Extendable for more traits like `Macroable`, `Loggable`, etc.

---

📦 Installation
--------------

[](#-installation)

### 1. Clone and build

[](#1-clone-and-build)

```
git clone https://github.com/yourname/traitify.git
cd traitify

phpize
./configure --enable-traitify
make
sudo make install
```

### 2. Enable in php.ini

[](#2-enable-in-phpini)

```
extension=traitify.so
```

### ✨ Example Usage

[](#-example-usage)

#### Singleton Trait

[](#singleton-trait)

```
