PHP probeer Sleutelwoord
Voorbeeld
Gebruik 'n probeer...vang-stelling om uitsonderings te hanteer:
<?php
try {
throw new Exception("This is an exception");
}
catch(Exception $e) {
echo $e->getMessage();
}
?>
Definisie en gebruik
Die try
sleutelwoord word gebruik om 'n try...catch
, of 'n try...catch...finally
stelling te skep.
Verwante bladsye
Die throw
sleutelwoord.
Die catch
sleutelwoord.
Die finally
sleutelwoord.
Lees meer oor try..catch.finally (Uitsonderings) in ons PHP -uitsonderingstutoriaal .
❮ PHP sleutelwoorde