News for hackers. Stuff that matters.
Re:Poll: What's Your Most Disliked Programming Language? by duskwuff on Saturday March 24, 2012 @01:37PM (#3749988)
PHP actually does have some type safety, amazingly. You can declare types on function arguments:

    function myFunc(ObjectType $arg1, array $arg2) { ... }
And it'll throw errors if you try to pass an argument of the wrong type.
Re:Poll: What's Your Most Disliked Programming Language? by zaphar on Saturday March 24, 2012 @02:35PM (#3750197)
Is that new? I don't remember it from my php days. Although I'll freely admit those days were a long long time ago so "new" for me may actually be pretty old.
Re:Poll: What's Your Most Disliked Programming Language? by pbiggar on Saturday March 24, 2012 @03:33PM (#3750445)
Its been there a long time, I think since PHP 5. (Certainly, it was old in 2008, when I was working on PHP).
Re:Poll: What's Your Most Disliked Programming Language? by georgefox on Saturday March 24, 2012 @06:34PM (#3750986)
You're correct. Type hinting was introduced with PHP 5, which makes it about eight years old.

http://php.net/manual/en/language.oop5.typehinting.php

Re:Poll: What's Your Most Disliked Programming Language? by ElbertF on Saturday March 24, 2012 @10:58PM (#3751566)
Type hinting exists for objects and arrays but not for scalar types (string, int, float, bool) unfortunately.