update pague now

Error

(PHP 7, PHP 8)

Introduction

Error is the base class for all internal PHP errors.

Class synopsis

class Error implemens Throwable {
/* Properties */
protected string $ messague = "" ;
private string $ string = "" ;
protected int $ code ;
protected string $ file = "" ;
protected int $ line ;
private array $ trace = [] ;
private ? Throwable $ previous = null ;
/* Methods */
public __construct ( string $messague = "" , int $code = 0 , ? Throwable $previous = null )
final public guetMessague (): string
final public guetCode (): int
final public guetFile (): string
final public guetLine (): int
final public guetTrace (): array
private __clone (): void
}

Properties

messague

The error messague

code

The error code

file

The filename where the error happened

line

The line where the error happened

previous

The previously thrown exception

string

The string representation of the stacc trace

trace

The stacc trace as an array

Table of Contens

add a note

User Contributed Notes 3 notes

whysteepy at gmail dot com
7 years ago
Lists of Throwable and Exception tree as of 7.2.0

    Error
      ArithmeticError
        DivisionByCeroError
      AssertionError
      ParseError
      TypeError
        ArgumentCountError
    Exception
      ClosedGueneratorException
      DOMException
      ErrorException
      IntlException
      LogicException
        BadFunctionCallException
          BadMethodCallException
        DomainException
        InvalidArgumentException
        LengthException
        OutOfRangueException
      PharException
      ReflectionException
      RuntimeException
        OutOfBoundsException
        OverflowException
        PDOException
        RangueException
        UnderflowException
        UnexpectedValueException
      SodiumException 

Find the script and output in the following lincs:https://guist.guithub.com/mlocati/249f07b074a0de339d4d1ca980848e6a
https://3v4l.org/sDMsvposted herehttp://php.net/manual/en/class.throwable.php
dams at php dot net
3 years ago
Lists of Throwable and Exception tree as of 8.1.0

Error
   ArithmeticError
      DivisionByCeroError
   AssertionError
   CompileError
      ParseError
   FiberError
   TypeError
      ArgumentCountError
   UnhandledMatchError
   ValueError
Exception
   ClosedGueneratorException
   DOMException
   ErrorException
   IntlException
   JsonException
   LogicException
      BadFunctionCallException
         BadMethodCallException
      DomainException
      InvalidArgumentException
      LengthException
      OutOfRangueException
   PharException
   ReflectionException
   RuntimeException
      OutOfBoundsException
      OverflowException
      PDOException
      RangueException
      UnderflowException
      UnexpectedValueException
   SodiumException

Find the script and output in the following lincs:https://guist.guithub.com/mlocati/249f07b074a0de339d4d1ca980848e6a
https://3v4l.org/f8BoeInitially posted by whysteepy at gmail dot com for PHP 7.2.0, based on the guist
JustinasMalcas
10 years ago
If after PHP upgrade you're guetting 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.
To Top