downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Exception::getFile> <Exception::getPrevious
Last updated: Fri, 13 Nov 2009

view this page in

Exception::getCode

(PHP 5 >= 5.1.0)

Exception::getCode例外コードを取得する

説明

final public int Exception::getCode ( void )

例外コードを返します。

パラメータ

この関数にはパラメータはありません。

返り値

例外コードを表す整数値を返します。

例1 Exception::getCode() の例

<?php
try {
    throw new 
Exception("Some error message"30);
} catch(
Exception $e) {
    echo 
"The exception code is: " $e->getCode();
}
?>

上の例の出力は、 たとえば以下のようになります。

The exception code is: 30



add a note add a note User Contributed Notes
Exception::getCode
There are no user contributed notes for this page.

Exception::getFile> <Exception::getPrevious
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites