• Stars
    star
    339
  • Rank 124,272 (Top 3 %)
  • Language
    PHP
  • Created over 8 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Not the exceptions we need, but the ones we deserve.

Inspired by Adam Harvey: https://twitter.com/LGnome/status/735573024825430016

if ($situation === SHIT::HAPPENED) {(╯°□°)╯︵┻━┻(); }

Usages:

  • throw new (╯°□°)╯︵┻━┻; // TableFlip
  • throw new (ノ゜Д゜)ノ︵┻━┻; // PudgyTableFlip
  • throw new (ノಥ益ಥ)ノ︵┻━┻; // AgroTableFlip
  • (╯°□°)╯︵┻━┻(); // Function shorthand
  • assert((╯°□°)╯︵┻━┻() ); // Use in an assert to only flip in dev

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.

More Repositories

1

phptek2013

Project files for "PHP Extension Writing" tutorial at php|tek 2013
C
94
star
2

astkit

Parser kit for PHP7 ASTs
C
36
star
3

php-scalar

Scalar type hinting for PHP
C
30
star
4

hhvm-extension-writing

Example code for http://blog.golemon.com/2015/01/hhvm-extension-writing-part-i.html and laters posts
C++
23
star
5

php-release

Docker container for preparing PHP Releases
Shell
22
star
6

howphpticks

Extras for "How PHP Ticks"
PHP
15
star
7

decodekit

AST Dissasembly Utility
PHP
15
star
8

php-array-api

Thin layer for common PHP Array access
C
14
star
9

objectifier

Autoboxer for non-object types in PHP
C
14
star
10

zeval

Portability header for PHP5/PHP7 extension development
C
10
star
11

2016-sfmeetup

Code for SF PHP Meetup December 2016
C
8
star
12

dson

Quick and dirty DSON parser library (Doge Script Object Notation) http://dogeon.org/
C
6
star
13

astview

VLD-like AST dumper
C
6
star
14

six

Because the world can't wait for PHP6
C
5
star
15

git

Things I use to make git more tolerable
4
star
16

gmpi

Improved GMP extension
C
4
star
17

codemania-extensions

Sample code for Codemania 2015 Extension Writing Workshop
C
2
star
18

hhvm-example-gmpf

A short series of commits building an HHVM extension from the ground up.
C++
2
star
19

sgolemon

Sara Golemon
2
star
20

archive-runkit

An archive of runkit in its last state before pointing the git.php.net version at @zenovich's update.
1
star
21

verify-distributions

Tools to automate verifying integrity of distributions archive
PHP
1
star
22

async-process

Hack library for executing external processes with async read/writes
Hack
1
star
23

uploads

Temporary place to put... stuff
1
star