private static function executeCommandQuery($commandExploded, Cube $cube, &$result) { $queryResult = 0; for ($i = $commandExploded[1]; $i <= $commandExploded[4]; $i++) { for ($j = $commandExploded[2]; $j <= $commandExploded[5]; $j++) { for ($k = $commandExploded[3]; $k <= $commandExploded[6]; $k++) { $queryResult += $cube->getValueAt($i, $j, $k); } } } $result[] = $queryResult; }