TypeError

(PHP 7)

Introduction

Il y a trois scénario où un TypeError peut être émit. La première c'est quand un argument passé à une fonction ne correspond pas à son type déclaré. Le second c'est quand une valeur retourner par une fonction ne correspond pas au type de retour déclaré de la fonction. La troisième c'est quand un nombre invalide d'arguments sont passé à une fonction intégré de PHP (mode strict uniquement).

Synopsis de la classe

TypeError extends Error {
/* Propriétés héritées */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Méthodes héritées */
final public Error::getMessage ( void ) : string
final public Error::getPrevious ( void ) : Throwable
final public Error::getCode ( void ) : mixed
final public Error::getFile ( void ) : string
final public Error::getLine ( void ) : int
final public Error::getTrace ( void ) : array
final public Error::getTraceAsString ( void ) : string
public Error::__toString ( void ) : string
final private Error::__clone ( void ) : void
}