This is great! I've always wanted to see optional type hinting for PHP. On Wed, Jul 1, 2009 at 10:09 AM, Gwynne Raskind <gwy...@darkrainfall.org>wrote:
> On Jul 1, 2009, at 12:59 PM, Ilia Alshanetsky wrote: > >> There has been quite a bit of discussion on this list, IRC, developer >> meetings, etc... about introduction of type hinting to PHP. Most people >> appear to think that this would be a good idea, but there is a reason why it >> is not in PHP already. The main source of conflict appears to be that in >> some cases typical type hinting is just too strict for PHP's typeless nature >> (most people expect that "1" == 1, while int type hint would definitely >> reject string "1"). Personally, I disagree with that opinion, but I can >> understand people who raise that issue. At work we've been using PHP 5.2 >> with type hinting for nearly 2 years now with great success, it makes code >> much easier to read and understand and the security benefit of type hinting >> is not to be under valued. In many cases type hinting can present a last >> line of defense against unexpected input for numeric fields, which are >> typically abused to do SQL injection. >> > [snip] > >> My hope is that the latest changes will allow this to become a standard >> part of PHP. >> > > +1 (+1000, actually :) > > -- Gwynne > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >