1.2.649. Magic Method Returntype Is Restricted¶
Some magic method have compulsory return types.
__destruct() :
void
__construct() :
void
__unserialize() :
void
__unset() :
void
__set() :
void
__serialize() :
array
__isset() :
bool
__toString() :
string
The others may use mixed, or a more restrictive one.
See also Magic Methods.
1.2.649.1. Suggestions¶
Use the right return type for the magic method
Do not use any return type