Skip to content

Instantly share code, notes, and snippets.

@ScreamingDev
Created September 1, 2013 15:50
Show Gist options
  • Select an option

  • Save ScreamingDev/6405307 to your computer and use it in GitHub Desktop.

Select an option

Save ScreamingDev/6405307 to your computer and use it in GitHub Desktop.
You never find the real problem
<?php
class EventHandler {
public static function preString() {
// imagine: echo (new Unknown());
throw new Exception('something went wrong');
}
}
class OhSnap {
function __construct() {
}
function __toString() {
EventHandler::preString();
}
}
$damn = new OhSnap();
try {
echo $damn;
} catch (Exception $e) {
echo "Well, you never get here.";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment