Skip to content

Bug when unpack specifc data #2

Description

@crazynds

The following code throws an erro:

<?php

$this->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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions