fix for zendframework/zf2#3458
Merge branch 'hotfix/3458' of git://github.com/netiul/zf2 into hotfix/3461
[#3461] CS fixes

- Trailing whitespace
[#3461] PHPUnit test fix

- $_SESSION is not always present from CLI and/or PHPUnit; check to see
  if it exists before using it. This prevents:
    - notice (undefined variable)
    - catchable fatal error (toArray returning null, which is then
      passed to fromArray() which expects an array)
Merge branch 'hotfix/3461' into develop

Close #3461