エラーコードを取得する
エラーコードを返します
この関数にはパラメータはありません。
エラーコードを int 型として返します
例1 Error::getCode の例
<?phptry { throw new Error("Some error message", 30);} catch(Error $e) { echo "The Error code is: " . $e->getCode();}?>
上の例の出力は、 たとえば以下のようになります。
The Error code is: 30