不是我们需要的例外,而是我们应得的例外。
Inspired by Adam Harvey: https://twitter.com/LGnome/status/735573024825430016
if ($situation === SHIT::HAPPENED) {(╯°□°)╯︵┻━┻(); }
Usages:
All three table-flip classes extend \Exception and implement the ┻━┻ interface, so the following works:
try {
$ret = doSomething();
if ($ret === null) {
throw new (╯°□°)╯︵┻━┻;
} elseif ($ret === false) {
throw new (ノಥ益ಥ)ノ︵┻━┻;
} elseif (!is_string($ret)) {
throw new (ノ゜Д゜)ノ︵┻━┻;
}
} catch (┻━┻ $e) {
┬─┬ノ(・_・ノ);
}
Note that the parentheses used in the class/function names here are U+FF08 FULLWIDTH LEFT PARENTHESIS and U+FF09 FULLWIDTH RIGHT PARENTHESIS since normal parens (U+0028/U+0029) are not allowed in PHP labels.
Similarly, the customary space is omitted entirely to make this a valid PHP label.
暂无开放 Issues,或尚未同步最近议题。