On Fri, 2008-01-04 at 10:28 -0800, Stanislav Malyshev wrote: > > 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?
Not necessarily, if you have a function that performs a generic operation on any object. As for resources you are right, it might be ideal to have "mysql resource" rather than just "resource", but just having the "resource" type hint is better than having no type hint. > Also, what use case might there be for "scalar"? This is one that I find very useful, much more than it may seem. I use scalar for any type of post/get input, printed output, or DB interaction, as objects/arrays/resources cannot be printed or stored in a database in a standardized way. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php