Fix PHP7 VIRT_ARRAY_INIT macro implementation.
Fix PHP7 VIRT_ARRAY_INIT macro implementation.

This is a PHP 7 compatibilty macro which was segfaulting due to the
temporary variable being defined in the do..while scoped block (to
swallow semicolon for macros), e.g:

zval *arr;
VIRT_ARRAY_INIT(arr);
VIRT_ADD_ASSOC_STRING(arr, "foo", "bar"); // <= segfault here

The VIRT_ARRAY_INIT above was expanding to:
do {
  zval z_arr; // <= local scope definition
  arr = &z_arr;
  array_init(arr);
} while (0)

After this patch, the macro expands to:
zval z_arr; // now defined in the scope of the macro caller
do {
    arr = &z_arr;
    array_init(arr);
} while (0)

which solved the issue.

Signed-off-by: Dawid Zamirski <c78f91f8d38347ecafcfdf3485415503566f7418@datto.com>
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

libvirt/libvirt-php,libvirt/libvirt-php,zippy2/libvirt-php,zippy2/libvirt-php,zippy2/libvirt-php,libvirt/libvirt-php