interface_with_tostring.phpt 276 B

123456789101112131415161718
  1. --TEST--
  2. Interface with __toString() method
  3. --FILE--
  4. <?php
  5. interface MyStringable {
  6. public function __toString(): string;
  7. }
  8. $rc = new ReflectionClass(MyStringable::class);
  9. var_dump($rc->getInterfaceNames());
  10. ?>
  11. --EXPECT--
  12. array(1) {
  13. [0]=>
  14. string(10) "Stringable"
  15. }