Skip to content

Instantly share code, notes, and snippets.

@dirkluijk
Last active December 21, 2015 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dirkluijk/6372015 to your computer and use it in GitHub Desktop.
Save dirkluijk/6372015 to your computer and use it in GitHub Desktop.
CODECEPTION!
<?php
class Inception
{
protected $inception;
public function __construct()
{
$this->checkLevel();
$this->inception = new Inception();
}
private function checkLevel()
{
$level = count(debug_backtrace()) + 3;
if($level >= ini_get('xdebug.max_nesting_level')) {
$message = '<span style="font-size: '.($level/2).'px">You have a </span>';
for($i = $level; $i > 0; $i--) {
$message .= '<span style="font-size: '.($i/2).'px">dream in a </span>';
}
$message .= '<br><br><br><span style="font-size: '.($level/2).'">You\'re definitely in limbo right now.</span>';
die($message);
}
}
}
// Example usage
$inception = new Inception();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment