Deprecation Warning: Methods with the Same Name as Their Class
In PHP, methods with the same name as their class will no longer be constructors in future versions. This issue arises when the constructor method's name matches the class name.
Error Message:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TSStatus has a deprecated constructor in ... on line 10
Affected Code:
class TSStatus
{
...
public function TSStatus($host, $queryPort)
...
}
Solution:
Replace the TSStatus method with __construct.
class TSStatus
{
...
public function __construct($host, $queryPort)
...
}
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3