Re: Scalar-type-hinting - which way is the best to go?
| From: | Sanford Whiteman | Date: | Mon, 19 Mar 2012 06:50:15 +0000 |
| Subject: | Re: Scalar-type-hinting - which way is the best to go? | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-59028@lists.php.net to get a copy of this message | ||
> But I just wanted to point out that this is something the author
> (and I) would never expect to happen ...
> in_array("123abc", array(3, 7, 123, 28)) === true
Well, would you never expect
select ( '123abc' in (3,7,123,28) )
to return boolean true in SQL?
Because it does.
Me, I'm happy with the parity of these two languages that so often
must work in tandem. YMMV but I don't see anything kooky. As Adam &
others have pointed out, the author of that blog post used the
original input as-is. Akin to passing a var into a sanitization
function (by value), getting a return true, and continuing processing
w/the initial var. I'm not saying I haven't done plenty of similarly
stupid things, but I don't see them as evidence to be entered against,
well, anything except my own incompetence.
-- S.