note 126196 added to language.exceptions

From: Date: Fri, 25 Jun 2021 14:54:25 +0000
Subject: note 126196 added to language.exceptions
Groups: php.notes 
Request: Send a blank email to php-notes+get-216549@lists.php.net to get a copy of this message
I would like to emphasise that you can not rethrow an Exception inside a catch-block and expect that the next catch-block will handle it. <?php try { throw new RuntimeException('error'); } catch (RuntimeException $e) { throw $e; } catch (Exception $e) { // this will not be executed[ } ?> ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.85.242 (proxied: 2001:16b8:4297:6400:2d60:9f5e:b275:e305) ---- Manual Page -- https://php.net/manual/en/language.exceptions.php Edit -- https://main.php.net/note/edit/126196 Del: integrated -- https://main.php.net/note/delete/126196/integrated Del: useless -- https://main.php.net/note/delete/126196/useless Del: bad code -- https://main.php.net/note/delete/126196/bad+code Del: spam -- https://main.php.net/note/delete/126196/spam Del: non-english -- https://main.php.net/note/delete/126196/non-english Del: in docs -- https://main.php.net/note/delete/126196/in+docs Del: other reasons-- https://main.php.net/note/delete/126196 Reject -- https://main.php.net/note/reject/126196 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#216549) next »