Last active
December 21, 2015 21:58
-
-
Save dirkluijk/6372015 to your computer and use it in GitHub Desktop.
CODECEPTION!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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