Code: Select all
while($row=$this->query->dbFetchArray('indexed'))
{
$association=unserialize($row[0]);
$this->associations[]=$association[0];
}[associations] => Array
(
[0] => 2277|2623
[1] => 2431|2480
)
But instead I get...
Code: Select all
їassociations] => Array
(
ї0] => 2277|2623
ї1] =>
)At each iteration of the loop, the $association var should be recreated by unserialize() correct? Well here is where it gets interesting as it appears that's not what's going on. I even added a third line to unset the $association var to ensure that it's created anew at each iteration. If you look at a var_dump of the $association var at each iteration you'll see something very strange.
Code: Select all
array(1) {
ї0]=>
string(9) "e;2277|2623"e;
}
array(1) {
ї1]=>
string(9) "e;2431|2480"e;
}This is downright strange and busts up the code as it's correct operation is predicated on the fact that at each iteration that array is only going to have one element and that element should be 0. Not an incrementing value.
If you don't know what I mean by "incrementing value", let me show you an example. If I am supposed to have 4 elements in that array then the var dump will look something like...
Code: Select all
array(1) {
ї0]=>
string(9) "e;2277|2623"e;
}
array(1) {
ї1]=>
string(9) "e;2431|2480"e;
}
array(1) {
ї2]=>
string(9) "e;2170|2623"e;
}
array(1) {
ї3]=>
string(9) "e;2399|2409"e;
}So is it just me or is there indeed something strange about this behaviour?