Error

(PHP 7)

はじめに

Error は、PHP のすべての内部エラーの基底クラスです。

クラス概要

Error implements Throwable {
/* プロパティ */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* メソッド */
public __construct ([ string $message = "" [, int $code = 0 [, Throwable $previous = NULL ]]] )
final public string getMessage ( void )
final public Throwable getPrevious ( void )
final public mixed getCode ( void )
final public string getFile ( void )
final public int getLine ( void )
final public array getTrace ( void )
final public string getTraceAsString ( void )
public string __toString ( void )
final private void __clone ( void )
}

プロパティ

message

エラーメッセージ

code

エラーコード

file

エラーが発生したファイル名

line

エラーが発生した行番号

目次

add a note add a note

User Contributed Notes 2 notes

up
9
JustinasMalkas
2 years ago
If after PHP upgrade you're getting error "PHP Fatal error:  Cannot declare class error, because the name is already in use ...", you will have to rename your "error" class.
Since PHP 7 classname "Error" is predefined and used internally.
up
1
Anonymous
3 months ago
And a static class called "error" when is trigged is renamed "Error" since PHP 7
To Top