![]() |
(array) or array()?
I really don't know how to sum this up but uhh, what's better or is it all the same? Such as:
PHP Code:
James |
They are both valid ways but you end up with slightly different results.
PHP Code:
For the sake of standards, you should probably use array() when creating new arrays. Things like (array) (int) (long) etc are generally only used when converting a variable type to another: PHP Code:
Alan. |
Quote:
|
Great answer Alan!
|
Explicit type casting shouldn't be used to initalize variables, but to ensure you get the right data type when using it (that's what I believe, however).
PHP Code:
|
| All times are GMT. The time now is 05:52 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0