Skip to content

Commit

Permalink
Fixed the call array_fill() with the number of elements 0 for PHP 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Ne-Lexa committed Nov 17, 2017
1 parent a3083b8 commit 4979829
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/PhpZip/Extra/Fields/ApkAlignmentExtraField.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ public static function getHeaderId()
*/
public function serialize()
{
$args = array_merge(
['vc*', $this->multiple],
array_fill(2, $this->padding, 0)
);
return call_user_func_array('pack', $args);
if ($this->padding > 0) {
$args = array_merge(
['vc*', $this->multiple],
array_fill(2, $this->padding, 0)
);
return call_user_func_array('pack', $args);
}
return pack('v', $this->multiple);
}

/**
Expand Down

0 comments on commit 4979829

Please sign in to comment.