granam/string

Lightweight string wrapper

Installs: 24 802

Dependents: 25

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

Type:project

4.2.2 2023-10-20 07:40 UTC

README

<?php
use Granam\String\StringObject;
use Granam\String\Exceptions\WrongParameterType;

$string = new StringObject(12345.678);
echo $string; // string '12345.678'

try {
  new StringObject(fopen('foo', 'rb'));
} catch (WrongParameterType $stringException) {
  // Expected scalar or object with \_\_toString method on strict mode, got resource.
  die('Something get wrong: ' . $stringException->getMessage());
}