The
new[] keyword will create a completely new array. You can't expand existing arrays with it. Also, you should use the array size
minus one when assigning something to the last index/field, since it starts at 0.
Not sure if it's necessary, but I always create arrays with a dynamic size like this:
PHP Code:
temp.array = {};
temp.array = new[]; // I believe this is also possible
You're also missing some this. prefixes in your code (that, or you got one where you don't want one).