Re: type hinting

From: Date: Fri, 04 Jan 2008 18:28:19 +0000
Subject: Re: type hinting
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-34439@lists.php.net to get a copy of this message
Exactly. I just added the "mixed" type hint which is the same as using no type hint. The new patch is attached.
IMO adding new type hint for the sole purpose of having some string next to the variable is just silly. If you need documentation, use documentation.
Extra keywords (real, long, double, etc.) have been taken out. The available type hints are now mixed, int, float, bool, string, scalar, num, resource, and object. And of course array and class type hints
Do you realize that hinting variable as "object" or "resource" has no meaning, since resources and objects are not interchangeable and you never want just "object" or "resource" - you want object of particular class and resource of particular type? Also, what use case might there be for "scalar"? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#34439) next »