On Thu, 14 Apr 2011 10:59:41 +0200, Eloy Bote Falcon <eloyb...@gmail.com> wrote:

What is the purpose of that generateHash function? It doesn't work in the
isset check.


Instead of using a multi-dimensional array, I use a flat array.

Anyway, you can do a simple $a = array('foo'); isset($a[$x][$y][$z]) without notices at all unless any of $x $y or $z are not defined, you don't need to
check the indexes one by one.


Well, the example was just for brevity. If you want a full-blown example:

if (!isset($a[$x])) {
 $a[$x] = array();
}

if (!isset($a[$x][$y])) {
 $a[$x][$y] = array();
}

if (!isset($a[$x][$y][$z])) {
 $a[$x][$y][$z] = array();
}

$a[$x][$y][$z] = 1;


Hope this clarifies.


--
Ole Markus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to