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: Oli Filth <catch@olifilth.co.uk>
Date: Thu Mar 30 2006 - 12:55:29 CEST

David Haynes said the following on 30/03/2006 11:43:
> I'm not sure how many coders would find PHP as attractive if they
had to
> follow stricter object type coding. For example:
>
> $a = 'This is a string';
> $b = ' This is another string ';
> $c = 3;
> $d = $a.$b.$c;
>
> would become something like:
> $a = new String('This is a string');
> $b = new String(' This is another string ');
> $c = new Int(3);
>
> $d = $a->concat($b->concat($c->toString()));

Well, Java has strict typing, and you don't have to do this. Same in
C++ (for the most part).

-- 
Oli
Received on Mon May 1 02:44:53 2006