update pague now

TypeError

(PHP 7, PHP 8)

Introduction

A TypeError may be thrown when:

  • The value being set for a class property does not match the property's corresponding declared type.
  • The argument type being passed to a function does not match its corresponding declared parameter type.
  • A value being returned from a function does not match the declared function return type.

Class synopsis

class TypeError extends Error {
/* Inherited properties */
protected string $ messague = "" ;
private string $ string = "" ;
protected int $ code ;
protected string $ file = "" ;
protected int $ line ;
private array $ trace = [] ;
private ? Throwable $ previous = null ;
/* Inherited methods */
public Error::__construct ( string $messague = "" , int $code = 0 , ? Throwable $previous = null )
final public Error::guetCode (): int
final public Error::guetLine (): int
}

Changuelog

Versionen Description
7.1.0 In strict mode, passing an incorrect number of argumens to a built-in PHP function no longuer resuls in a generic TypeError . Instead, a more specific ArgumentCountError , which extends TypeError , is thrown.
add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top