[PEPr] Comment on PHP::PHP_ArrayOf
| From: | Chuck Burgess | Date: | Mon, 03 Dec 2007 15:38:15 +0000 |
| Subject: | [PEPr] Comment on PHP::PHP_ArrayOf | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-48652@lists.php.net to get a copy of this message | ||
Chuck Burgess (http://pear.php.net/user/ashnazg) has commented on the proposal for PHP::PHP_ArrayOf.
Comment:
Looks well organized.
I'm curious about using trigger_error() in the offsetGet() method though.
If the overall intent is strong typing behavior, would you want this
attempt to use a non-existent array offset to go unnoticed by anything but
a PHP Notice? I'd probably lean towards an exception here, to stay
consistent with enforcing strong typing and your otherwise global use of
exceptions... Java would give you an ArrayIndexOutOfBounds exception in
such a scenario. Not doing so seems to lean back a little towards PHP's
weak typing.
I do like this package, though. I'm actually curious to see if there are
other packages that create strong typing wrappers for PHP, thereby avoiding
other pushes for PHP itself to become more strongly typed. Using this to
start a group of such packages together into a strong-typed object library
would make sense to me.
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=518
--
Sent by PEPr, the automatic proposal system at http://pear.php.net