Re: Warning for "confusable" types
| From: | Stanislav Malyshev | Date: | Fri, 11 Oct 2019 18:54:20 +0000 |
| Subject: | Re: Warning for "confusable" types | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107524@lists.php.net to get a copy of this message | ||
Hi!
> Something I've seen play out a couple of times: Newbies try to use
> something like "integer" or "resource" as a type, and then get a confusing
> error message along the lines of "must be an instance of resource, resource
> given".
Maybe we should just change the error message to this?
must be an instance of the class "resource", but resource type is given
OTOH, since there are actually no resource type hints, and naming your
class "resource" is an extremely bad idea, having a warning there
wouldn't hurt too.
--
Stas Malyshev
smalyshev@gmail.com