Re: RE: Optional scalar type hinting

From: Date: Fri, 04 Jan 2008 01:11:02 +0000
Subject: Re: RE: Optional scalar type hinting
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-34385@lists.php.net to get a copy of this message
You aren't making it a strict static typed language. All that you are doing is saying that at certain points (function entry) that the values are checked and converted to certain types. If within the fuction an argument hinted as integer is used in a string context, the juggling will still happen.
So it's basically another way to say (string)? Again, that's not what was said by other people discussing it. But all that just to save one (string) inside function?
What you are doing to allowing the function author to protect the integrity of his code without having to resort to a regex/... to check what the arguments are.
If you need regex, you'd still have to use regex. Type juggling can do only so much. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#34385) next »