Re: Continued try blocks

From: Date: Mon, 29 Apr 2013 06:25:29 +0000
Subject: Re: Continued try blocks
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi Julien,

I'm still on the fence, not sure if it isn’t too opaque.

Am 26.04.2013 um 16:41 schrieb Julien Pauli <[email protected]>:
[...]

One question regarding scoping: does the next statement inherit the scope of the catch block like
this?

try {
   $user = $repository->findById(123);
   $user->setName($name);
   $em->save($user);
   return true;
} catch (NotFoundException $e) {
   $user = new User();
   continue;
} catch (ValidationException $e) {
   $user->setName($this->stripInvalidChars($name));
   continue;
} catch (PersistenceException $e) {
   return false;
}

cu,
Lars


Thread (33 messages)

« previous php.internals (#67190) next »