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
Changelog
| Version | Description |
|---|---|
| 7.1.0 | In strict mode, passing an incorrect number of arguments to a built-in PHP function no longer results 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 page.