[RFC] Type hints (parameter and return value)

From: Date: Thu, 17 Apr 2008 03:50:55 +0000
Subject: [RFC] Type hints (parameter and return value)
Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hello again!

Now with both parameter and return value type hints.

For parameter type hints, i have completed the actual implementation
with the leftover php types:
- string (binary string and unicode)
- integer (accepting numeric string too)
- double (accepting numeric string too)
- boolean ('0', '1', true, false)
- resource
- object

(Yes, following our dynamic typing)


Since then, the patch also includes new methods to Reflection:
- isInt()
- isDouble()
- isBool()
- isString()
- isObject()
- isResource()


And for return value, i have modified and improved the previous patch,
and now it is using only the "(type)" notation. Hence, that
implementation doesn't make any BC break.


Examples, patches and tests: http://wiki.php.net/rfc/typehint


Thanks.

-- 
Regards,
Felipe Pena.



Thread (31 messages)

« previous php.internals (#37049) next »