php - Break from try/catch block -
is possible in php?
try{ $obj = new clas(); if($obj->foo){ // how exit try block? } // other stuff here }catch(exception $e){ ]
i know can put other stuff between {}
, increases indenting on bigger code block , don't :p
i know increases indentation an answer
try { $obj = new clas(); if ($obj->foo) { // stuff here } else { // other stuff here } } catch (exception $e) { // handle exceptions here }
Comments
Post a Comment