rfc:noreturn_type
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
rfc:noreturn_type [2021/03/19 15:48] – Add returning by reference example mattbrown | rfc:noreturn_type [2021/03/30 14:55] – Add __toString example mattbrown | ||
---|---|---|---|
Line 134: | Line 134: | ||
class B extends A { | class B extends A { | ||
public function & | public function & | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Returning '' | ||
+ | |||
+ | <code php> | ||
+ | class A implements Stringable { | ||
+ | public function __toString(): | ||
+ | return " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | class B extends A { | ||
+ | public function __toString(): | ||
+ | throw new \Exception(' | ||
+ | } | ||
} | } | ||
</ | </ |
rfc/noreturn_type.txt · Last modified: 2021/04/19 09:31 by nikic