PHP 7.2.0 Release Candidate 4 Released

Error

(PHP 7)

Introdução

Error é a classe base para todas as exceções de erros internos do PHP.

Sinopse da classe

Error implements Throwable {
/* Propriedades */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Métodos */
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 )
}

Propriedades

message

A mensagem de erro

code

O código do erro

file

O nome do arquivo onde o erro aconteceu

line

A linha onde o erro aconteceu

Índice

add a note add a note

User Contributed Notes 2 notes

up
13
JustinasMalkas
1 year 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
1 month ago
And a static class called "error" when is trigged is renamed "Error" since PHP 7
To Top