Re: Resume keyword

From: Date: Thu, 21 Jun 2012 06:59:49 +0000
Subject: Re: Resume keyword
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-60916@lists.php.net to get a copy of this message
2012/6/20 Michael Morris <dmgx.michael@gmail.com> > [/snip] > > An example for additional clarity. > > set_exception_handler(function ($e) { > echo $e->getMessage(); > // Don't know if this is correct - but should be able to illustrate here > if ($e->getCode() == E_NOTICE & E_STRICT) { > resume null; > } > > echo 'Dying now'; exit; > }); > > throw new Exception('A test', E_NOTICE); > > echo "We didn't die"; > > The code above when run would echo "A test. We didn't die."; > > > Whats about $user = $this->getUser(); // Throws exception echo $user->getName(); Now the second one will fail too, but in reality it shouldn't even get executed... Regards, Sebastian > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#60916) next »