et-nik / et-nik/binn-php

Bug when unpack specifc data

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The following code throws an erro:
```php
bin = new Binn();
$data = $this->bin->serialize([
[
"Astrá",
6,
]
]);
$this->bin->unserialize($data);
```
Error:
```
ErrorException {#2094 ▼ // vendor\knik\binn\src\BinnAbstract.php:457
#message: "unpack(): Type C: not enough input values, need 1 values but only 0 were provided"
#code: 0
#file: "
C:\Users\Administrator\Desktop\workspace\PCare\vendor
\knik\binn\
src\BinnAbstract.php"
#line: 454
#severity: E_WARNING
```

The error disapear if:

- If I remove the number in the end of the array
- If I remove the string element
- If I swap the order of the elements in array
- If the array is only one deep
- If I remove the character 'á'

If I add other elements to array in any order, the exception occurr in the same way.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.