Skip to content

Instantly share code, notes, and snippets.

@immutef
Last active August 29, 2015 14:01
Show Gist options
  • Save immutef/de9cb5e778d8651ddaeb to your computer and use it in GitHub Desktop.
Save immutef/de9cb5e778d8651ddaeb to your computer and use it in GitHub Desktop.
<?php
class Inception extends Exception
{
static private $timesThrown = 0;
public function __construct($message = null, $code = 0)
{
if (++static::$timesThrown <= 3) {
throw new Inception($message, $code);
}
parent::__construct($message, $code);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment