Looks like there will be a memory leak here.

You will need to define

`zval *key = NULL;`

outside of the `while` loop and use `PHALCON_INIT_NVAR(key);` in the loop.