Re: RFC: Type hinting revisited for PHP 5.3
| From: | Hannes Magnusson | Date: | Wed, 01 Jul 2009 20:42:05 +0000 |
| Subject: | Re: RFC: Type hinting revisited for PHP 5.3 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44605@lists.php.net to get a copy of this message | ||
On Wed, Jul 1, 2009 at 22:29, Stanislav Malyshev<stas@zend.com> wrote:
> Hi!
>
>> C does not have booleans, they are emulated via smallint/tinyint. As far
>> as your other message goes, this patch does nothing to affect how native
>> functions handle args.
>
> Right. So we would have two APIs for types - one coercing (for internals)
> and one strict (for user functions), which would work in entirely different
> way. Is that good?
How is that different from what we have already?
Internally you type hint (arginfo) what you want, in userland you'll
be able to do that too (int $foo).
Internally you parse arguments (param parsing, casting), in userland
you do that already (function fo($var) {$var = (string)$var})
I don't understand what "work entirely different" you are talking
about. This is how PHP already works.
-Hannes