Re: Re: array or list of objects of different types
| From: | Peter Pei | Date: | Sat, 03 Apr 2010 14:57:36 +0000 |
| Subject: | Re: Re: array or list of objects of different types | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303784@lists.php.net to get a copy of this message | ||
And that's why language like C# and java supports <> to restrict the type of data a collection can hold. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/var_dump( array( true , 12 , "php already does this" ) ); array(3) { [0]=> bool(true) [1]=> int(12) [2]=> string(21) "php already does this" } :)Yeah. But this feature of PHP is a boon if used carefully and a curse if careless. You can get AMAZING results if you're not careful to check the data types ;)