Skip to content

Instantly share code, notes, and snippets.

@sasezaki
Created December 15, 2013 07:31
Show Gist options
  • Save sasezaki/7970029 to your computer and use it in GitHub Desktop.
Save sasezaki/7970029 to your computer and use it in GitHub Desktop.
<?php
class TestClass
{
private $internalScalar;
public function __construct($arg)
{
$this->internalScalar = $arg;
}
}
set_error_handler(function($errno, $errstr, $errfile, $errline) {
throw new Exception;
});
function func(TestClass $a) {
return $a;
}
$arg = 1;
try {
retry:
func($arg);
var_dump('done');
} catch (Exception $e) {
$arg = new TestClass($arg);
goto retry;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment