MathPHP\SetTheory\Set::__toString PHP Method

__toString() public method

..}
public __toString ( ) : string
return string
    public function __toString() : string
    {
        if ($this->isEmpty()) {
            return 'Ø';
        }
        return 'Set{' . implode(', ', array_keys($this->A)) . '}';
    }

Usage Example

Example #1
0
 /**
  * @dataProvider dataProviderForToString
  */
 public function testToString(array $members, string $expected)
 {
     $set = new Set($members);
     $this->assertEquals($expected, $set->__toString());
 }