php[tek] 2018 : Call for Speakers

Error

(PHP 7)

Introducción

Error es la clase base para todos los errores de PHP internos.

Sinopsis de la Clase

Error implements Throwable {
/* Propiedades */
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 )
}

Propiedades

message

El mensaje de error

code

El código de error

file

El nombre del fichero donde ocurrió el error

line

La línea donde ocurrió el error

Tabla de contenidos

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
3 months ago
And a static class called "error" when is trigged is renamed "Error" since PHP 7
To Top