The Stringable interfaceIntroductionThe Stringable interface denotes a class as having a __toString() method. Unlike most interfaces, Stringable is implicitly present on any class that has the magic __toString() method defined, although it can and should be declared explicitly.
Its primary value is to allow functions to type check against the union
type Interface synopsis
Stringable
/* Methods */
public string Stringable::__toString()
Stringable Examples
Example #1 Basic Stringable Usage This uses constructor property promotion.
The above example will output something similar to: 123.234.42.9
|