On Thu, 14 Apr 2011 15:25:45 +0200, Martin Scotta <martinsco...@gmail.com>
wrote:
arrays are intent for holding values, not for represent things so use
objects for that.
the need for array_key_exists/isset to check for the presence of an
index is
a smell that you need to refactor your code for a different datatype.
There is quite a difference in performance between using an array
representation of data structures such as graphs, matrices, etc and using
an OO representation. Also with the inclusion of closures it is possible
to write very elegant code using arrays and array functions such as
array_walk, array_map etc. If the multi-dimensional array is sparse, you
cannot really avoid a lot of isset calls.
Also, if you want to output everything as json in the end, working on
arrays is very natural.
--
Ole Markus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php