diff --git a/tests/Struct.php b/tests/Struct.php index c298f86..a935345 100644 --- a/tests/Struct.php +++ b/tests/Struct.php @@ -37,15 +37,15 @@ class Struct * Packs data into bytes * * @param $format Format string - * @param ...$data Parameters to encode + * @param $data Parameters to encode * * @return Encoded data */ - public static function pack($format, ...$data) + public static function pack($format, $data) { self::constructor(); - return self::$struct->pack($format, ...$data); + return self::$struct->pack($format, $data); } /** diff --git a/tests/StructClass.php b/tests/StructClass.php index f910e4d..2171bed 100644 --- a/tests/StructClass.php +++ b/tests/StructClass.php @@ -38,11 +38,11 @@ class StructClass * * Packs data into bytes * - * @param ...$data Parameters to encode (may contain format string) + * @param $data Parameters to encode (may contain format string) * * @return Encoded data */ - public function pack(...$data) + public function pack($data) { if ($this->format === null) { $format = array_shift($data); @@ -50,7 +50,7 @@ class StructClass $format = $this->format; } - return $this->struct->pack($format, ...$data); + return $this->struct->pack($format, $data); } /** diff --git a/tests/StructTools.php b/tests/StructTools.php index be79a51..3a107d2 100644 --- a/tests/StructTools.php +++ b/tests/StructTools.php @@ -249,12 +249,13 @@ class StructTools * Packs data into bytes * * @param $format Format string - * @param ...$data Parameters to encode + * @param $data Parameters to encode * * @return Encoded data */ - public function pack($format, ...$data) + public function pack($format, $data) { + $data = [$data]; $format = $this->padformat($format); $result = null; // Data to return $size = $this->calcsize($format); diff --git a/tests/testing.php b/tests/testing.php index 20b748a..f472e00 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -80,7 +80,7 @@ function random_string($length) } function gen_payload() { - return \danog\PHP\Struct::pack('