Object[] type hint
| From: | Sebastian Bergmann | Date: | Mon, 05 Feb 2007 05:57:14 +0000 |
| Subject: | Object[] type hint | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-27789@lists.php.net to get a copy of this message | ||
Hi,
any chance for the following type hint syntax
class Example
{
public function doSomething(Object[] $objects)
{
}
}
instead of having to write
class Example
{
public function doSomething(Array $objects)
{
foreach ($objects as $object) {
if (!$object instanceof Object) {
throw new InvalidArgumentException;
}
}
}
}
Thanks,
Sebastian
--
Sebastian Bergmann http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69