Skip to content

Latest commit

 

History

History
67 lines (49 loc) · 1.52 KB

SplString.md

File metadata and controls

67 lines (49 loc) · 1.52 KB

(PHP 7, PHP 8)

The SplString class is used to enforce strong typing of the string type.

SplString extends SplType {
    /* Constants */
    public const string __default = '';
    /* Methods */
    public function __construct ([ string $initial_value = '' ])
    final public function &__invoke(): string
}

SplString::__default

Example #1 SplString usage example

<?php
$string = new SplString("Testing");

var_dump($string);
echo $string; // Outputs "Testing"

The above example will output:

object(SplString)#1 (1) {
    ["__default"] => string(7) "Testing"
}
Testing