Re: Strict types
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Strict types

From: Andy Jeffries <news@andyjeffries.co.uk>
Date: Thu Mar 30 2006 - 10:58:22 CEST

On Thu, 30 Mar 2006 00:53:47 -0800, Treefrog wrote:
> For a while now I've been wishing PHP had (at least the option to enable)
> strict types. It would help a massive amount in BIG applications, and
> maybe start to taper the millions of lines of crap code that's out there.

To be honest the only real problem is with objects. For large
applications a consistent naming scheme helps with simple variables and in
a lot of cases it's not really important what the variable is.

With regards to objects, PHP5 now has type hints which ensures a parameter
to a function or method is of a given type (class):

function bar(Foo $foo)
{
  ...
}

Cheers,

Andy

-- 
Andy Jeffries MBCS CITP ZCE   | gPHPEdit Lead Developer
http://www.gphpedit.org       | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Received on Mon May 1 02:44:50 2006