function main() { // Generate a prologue for thrower: try { thrower(); } catch (Exception $x) { } // Push down bytecode offsets for ($i = 0; $i < 10; ++$i) { mt_rand(); } for ($i = 0; $i < 10; ++$i) { mt_rand(); } for ($i = 0; $i < 10; ++$i) { mt_rand(); } for ($i = 0; $i < 10; ++$i) { mt_rand(); } for ($i = 0; $i < 10; ++$i) { mt_rand(); } for ($i = 0; $i < 10; ++$i) { mt_rand(); } for ($i = 0; $i < 10; ++$i) { mt_rand(); } for ($i = 0; $i < 10; ++$i) { mt_rand(); } $z = better_handle_exceptions_if_you_inline(); var_dump($z); }
function baz($a) { try { $a = thrower($a); } catch (Exception $e) { $a = 0; } return $a; }
function foo() { foreach (array(1, 2, 3) as $x) { try { thrower(); } catch (MyJunk $z) { echo "Not Here\n"; } } }
<?php class MyException extends Exception { public function __construct() { } } function thrower() { throw new MyException(); } try { thrower(); } catch (Exception $exn) { $a = $exn->getTrace(); foreach ($a as &$b) { $b['file'] = 'string'; } var_dump($a); var_dump($exn->getLine()); }