# Type hinting

- Thread: https://externals.io/message/48431
- Original archive: https://news-web.php.net/php.internals/48431
- Started by spam@geleia.net on 2010-05-24T12:33:12+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #48431 — spam@geleia.net — 2010-05-24T12:33:12+00:00

URL: https://externals.io/message/48431#48431

>
> Sounds acceptable to me, that's along the lines of the 3rd option
> which appears to be getting the most traction.  I'd also no conversion of
> arrays to scalars to that list.
>

Arrays to scalars already fail. See
http://wiki.php.net/rfc/typecheckingstrictandweak#current_behavior_of_zend_parse_parameters

<?php
var_dump(strtoupper(array("abc")));

gives:
Warning: `strtoupper()` expects parameter 1 to be string, array given in ...
on line 2
 `NULL` 

To respond to Jordi Boggiano, I am not advocating changing the behavior of
cast, only of internal functions' argument parsing.

Also, I think it doesn't make sense to allow "17.", but disallow "17.5"
when an int is expected. See floating point arithmetic and equality
comparisons.

-- 
Gustavo Lopes
