“PHP Catch Fatal Erro” Respostas de código

Exceção de captura do PHP


<?php
function inverse($x) {
    if (!$x) {
       throw new Exception('Division durch Null.');
    }
    return 1/$x;
}

try {
    echo inverse(5) . "\n";
    echo inverse(0) . "\n";
} catch (Exception $e) {
    echo 'Exception abgefangen: ',  $e->getMessage(), "\n";
}

// Ausführung fortsetzen
echo "Hallo Welt\n";
?>

Vadris_

PHP Catch Fatal Erro

try {
   do some thing evil
} catch (Error $e) {
   echo 'Now you can catch me!';
}
Prickly Pelican

Respostas semelhantes a “PHP Catch Fatal Erro”

Perguntas semelhantes a “PHP Catch Fatal Erro”

Mais respostas relacionadas para “PHP Catch Fatal Erro” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código