note 70124 added to language.exceptions

From: Date: Wed, 04 Oct 2006 08:59:03 +0000
Subject: note 70124 added to language.exceptions
Groups: php.notes 
Request: Send a blank email to php-notes+get-118021@lists.php.net to get a copy of this message
@dexen at google dot me dot up I think you just re-invented the 'finally' keyword. This code snippet will do basically the same (and does it cleaner) as your 'locker class': <?php function updateStuff() { DB::query('LOCK TABLES a, b, c WRITE'); try { someFunction(); } catch(Exception $e) { // handle exception } finally { /* Will ALLWAYS be executed */ DB::query('UNLOCK TABLES'); } } ?> ---- Server IP: 194.109.193.119 Probable Submitter: 212.189.36.79 (proxied: unknown, unknown) ---- Manual Page -- http://www.php.net/manual/en/language.exceptions.php Edit -- https://master.php.net/note/edit/70124 Del: integrated -- https://master.php.net/note/delete/70124/integrated Del: useless -- https://master.php.net/note/delete/70124/useless Del: bad code -- https://master.php.net/note/delete/70124/bad+code Del: spam -- https://master.php.net/note/delete/70124/spam Del: non-english -- https://master.php.net/note/delete/70124/non-english Del: in docs -- https://master.php.net/note/delete/70124/in+docs Del: other reasons-- https://master.php.net/note/delete/70124 Reject -- https://master.php.net/note/reject/70124 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#118021) next »