fork(1) download
  1. <?php
  2.  
  3. class AcceptedException extends \Exception
  4. {
  5. }
  6.  
  7. try {
  8. $obj = (object) ['foo' => 'bar'];
  9. if ($obj->foo) {
  10. throw new \AcceptedException;
  11. }
  12. } catch(\AcceptedException $e) {
  13. var_dump('I was accepted');
  14. } catch(\Exception $e) {
  15. throw $e; //don't handle the exception
  16. }
  17. var_dump($obj->foo);
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
string(14) "I was accepted"
string(3) "bar"