Created
December 11, 2015 20:19
-
-
Save bobmagicii/2df74b6d1afa42e7b525 to your computer and use it in GitHub Desktop.
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 Whatevs { | |
public function | |
__ToString() { | |
/*// | |
try to generate the string we need, else show a fallback. | |
//*/ | |
try { | |
$Output = $this->FailHard(); | |
} | |
catch(Exception $Error) { | |
$Output = 'It Failed Hard.'; | |
} | |
return $Output; | |
} | |
protected function | |
FailHard() { | |
throw new Exception('diaf'); | |
} | |
} | |
class Wonky | |
extends Whatevs { | |
} | |
$Whatevs = new Wonky; | |
echo $Whatevs; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment