As an alternative way of returning and accessing you could use the provided "Zend magic".
In a Controller, return as so:
return [ 'getName' => $this->params()->fromQuery('get_var', null), 'postName' => $this->params()->fromPost('post_var', null), ];
The magic here is that a ViewModel is automagically created for you. The second piece of magic is that the returned keys are set as variables in the newly created ViewModel.
(edit: just spotted this link provided by @Garry in his answer which already contains the above)
In the ViewModel you could also make use of some of the Zend Framework magic. You could use $getName and $postName instead of $this->getName/$this->postName. So, to print do:
<?= $getName ?: 'No GET params given' ?> <?= $postName ?: 'No POST params given' ?>