Replaced casting to array with ->getArrayCopy(). Fixes issue with HHVM.