PHPackages                             omarwebdev/plass - 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. omarwebdev/plass

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

omarwebdev/plass
================

The ultimate solution for converting PHP's built-in functions into class methods!

v1.0.0(3y ago)17MITPHPPHP &gt;8.0CI failing

Since Feb 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/OmarWebDev/plass)[ Packagist](https://packagist.org/packages/omarwebdev/plass)[ RSS](/packages/omarwebdev-plass/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Plass
=====

[](#plass)

Introducing Plass, the ultimate solution for converting PHP's built-in functions into class methods! With Plass, you can access PHP's functions in a more intuitive and readable way.

For example, the `strtoupper` function can now be called as `Str::of('some string')->toUpperCase()`. This not only makes your code more readable, but it also makes it easier to understand what each method does, without having to refer to the PHP manual.

Plass covers all wil cover all the common PHP functions, including string manipulation, array operations, and more. With its concise and consistent API, you can use familiar method names to perform the same operations as in PHP.

In addition, Plass includes a comprehensive test suite to ensure compatibility with the latest version of PHP and to ensure that your code will continue to work as expected.

Whether you're a beginner or an experienced developer, Plass will make your life easier by providing a better, more intuitive way to access PHP's functions. Try it today and see the difference for yourself!

Why use Plass?
--------------

[](#why-use-plass)

- Improved Readability: By converting PHP functions into class methods, Plass makes your code more readable and understandable. Instead of using cryptic function names, you can now use intuitive and descriptive method names, making it easier to follow your code's logic.
- Consistent API: Plass provides a consistent API for all functions, making it easier to remember how to perform each operation. No more having to flip back and forth between the PHP manual to figure out how to use a function.
- Better Code Organization: By encapsulating functions into classes, Plass allows you to organize your code into meaningful groups. This makes it easier to find and reuse code, and also helps to prevent naming collisions.
- Improved Syntax: Plass uses a fluent syntax, allowing you to chain methods together to perform complex operations. This makes your code more concise and less verbose, leading to fewer bugs and easier maintenance.
- Comprehensive Test Suite: Plass includes a comprehensive test suite, ensuring compatibility with the latest version of PHP and ensuring that your code will continue to work as expected.

Whether you're a beginner or an experienced developer, Plass will make your life easier by providing a better, more intuitive way to access PHP's functions. So why not try it today and see the difference for yourself?

Usage for strings:
------------------

[](#usage-for-strings)

### Create a string

[](#create-a-string)

PHP normal way of creating a string is simple for example:

```
$str = "Some String";

echo $str; // prints "Some String"
```

Well, when using Plass it is a little different because you have to create a new instance of Str class for example:

```
use OmarWebDev\Plass\Facade\Str;

$str = new Str('Some String');

echo $str; // prints "Some String"
```

You can also use static method called of instead of using new keyword for example:

```
use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String'); // same as new Str('Some String')

echo $str; // prints "Some String"
```

### Method chaining

[](#method-chaining)

Yes, Plass supports method chaining for example:

```
use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String')
            ->toUpperCase();
echo $str; // prints "SOME STRING"
```

### Accessing the value of the string

[](#accessing-the-value-of-the-string)

In Plass it is possible to access the string without calling any methods using php type casting for example:

```
use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String');

$str = (string) $str; // returns "Some String"
```

However, if you don't want to use php string type cast you can use toString method for example:

```
use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String');

$str = $str->toString(); // same as (string) $str
```

### Accessing character at specific index

[](#accessing-character-at-specific-index)

While plass is using class it is still possible to access character by index for exmaple:

```
use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String');

$char = $str->charAt(0); // returns "S"
$char = $str[0]; // returns "S"
```

### Changing string

[](#changing-string)

You can easily change the string by just creating a new instance, but what if you want to keep the old string and just edit a character? Plass provides a way to change a character in a string without creating a new instance for example:

```
use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Example');

$str[0] = 'R'; // changes letter "E" to "R"
$str[] = ', Hello'; // adds ", Hello" to the string
unset($str[0]); // removes the first letter in the string
$str[0] = ''; // removes the first letter in the string
echo $str; // prints "ample, Hello"
```

### Available Methods

[](#available-methods)

Only methods that returns `Str` is chainable. Chainable methods means that you can chain methods for example: `Str::of('someString')->toUpperCase()->trim()->shuffle()`

#### charAt(int $index): string|null

[](#charatint-index-stringnull)

This method returns the character in a specific index of the string or null if index is out of range.

Note: The original string is not modified.

#### toUpperCase(): Str

[](#touppercase-str)

Convert string letters to upper case.

#### toLowerCase(): Str

[](#tolowercase-str)

Convert string letters to lower case.

#### repeat(int $count): string

[](#repeatint-count-string)

repeat a string for the given number of times.

Note: The original string is not modified.

#### trim(): Str

[](#trim-str)

Removes whitespace from the beginning and end of a string.

#### substr(int $start, ?int $length): string

[](#substrint-start-int-length-string)

Returns a part of string. Note: The original string is not modified.

#### substrReplace(array|string $replace, array|int $offset, array|int|null $length = null): Str

[](#substrreplacearraystring-replace-arrayint-offset-arrayintnull-length--null-str)

Replace a part of string by offset and length.

#### shuffle(): Str

[](#shuffle-str)

Shuffles the string letters ex. abc =&gt; bca.

#### replace(array|string $search, array|string $replace): Str

[](#replacearraystring-search-arraystring-replace-str)

Replaces a part of a string in the string with other string

#### contains(string $search): bool

[](#containsstring-search-bool)

Checks if a string contains a substring.

Contribution
------------

[](#contribution)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Installation:

Copy the repository and create a new branch.

Install dependencies:

```
composer install
```

Run tests

```
composer test
```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1191d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36b7f2146d82dd311930334d81cae70222ee738f1c3d9e6b01317717abd6ccbf?d=identicon)[OmarWebDev](/maintainers/OmarWebDev)

---

Top Contributors

[![OmarWebDev](https://avatars.githubusercontent.com/u/52567999?v=4)](https://github.com/OmarWebDev "OmarWebDev (16 commits)")

---

Tags

compatibilityTest SuitePHP functionsClass methodsFunction conversionReadable codeIntuitive APIImproved syntaxImproved code organization

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/omarwebdev-plass/health.svg)

```
[![Health](https://phpackages.com/badges/omarwebdev-plass/health.svg)](https://phpackages.com/packages/omarwebdev-plass)
```

###  Alternatives

[symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

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

Symfony polyfill for ctype functions

4.0k982.0M125](/packages/symfony-polyfill-ctype)[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)

PHPackages © 2026

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