Re: type hinting

From: Date: Mon, 07 Jan 2008 18:16:42 +0000
Subject: Re: type hinting
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-34588@lists.php.net to get a copy of this message
Afternoon, Wow, go away for a weekend and look what happens... Personally I think the issue is that true "scalar" type hinting doesn't make much sense with a dynamically typed language. Deciding if/when/how to juggle a scalar typehint is going to make at least one person angry and some new user confused. However, I have to agree with the fact that the current typehinting system feels "unfinished". I can tell a function that it has to be passed an array or some specific type of object, but can't tell it that it has to be passed a scalar type, or a resource, or any generic object. These don't "juggle" well like the generic scalar (int, bool, float, string) types. Is there any reason we can't at least add "scalar" and "resource" (and possibly "object" for generic objects) to typehints? It wouldn't be the full "scalar typehinting" solution that people are yelling for, but it would cut out lines of bad input handling in my own code, and make the current typehint solution feel more complete. My own $0.02, Elizabeth Smith

« previous php.internals (#34588) next »