Re: type hinting
| From: | Lars Strojny | Date: | Fri, 04 Jan 2008 17:30:41 +0000 |
| Subject: | Re: type hinting | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34421@lists.php.net to get a copy of this message | ||
Hi Sam,
Am Freitag, den 04.01.2008, 12:11 -0500 schrieb Sam Barrow:
[...]
> Exactly. I just added the "mixed" type hint which is the same as using
> no type hint. The new patch is attached.
[...]
To make your patch better you should add a bunch of test cases. Just a
test brainstorming:
* Current behaviour (no type hinting) works as expected
* Current behaviour for class type hinting works
* Scalar type hints are enforced to be lowercase ("Int" hints a
class, "int" a primitive)
* All new type hints work
* All new type hint aliases work
* All new type hints throw errors if wrong types are passed
* Meta type hints (like "mixed", "num", etc.) work
* Reflections on type hints work (foo(string $str);
ReflectionParam::getType() => "string",
ReflectionParam::isArray() => false and the like)
There are already a few test cases for type hinting in
tests/classes/type_hinting_*.phpt for you to look at.
cu, Lars
Attachment: [application/pgp-signature] Dies ist ein digital signierter Nachrichtenteil signature.asc
Attachment: [application/pgp-signature] Dies ist ein digital signierter Nachrichtenteil signature.asc