Giter Site home page Giter Site logo

a PHP Warning about msgpack-php HOT 4 CLOSED

msgpack avatar msgpack commented on July 19, 2024
a PHP Warning

from msgpack-php.

Comments (4)

laruence avatar laruence commented on July 19, 2024

could you show me the reproduce case?

I mean the target bin data....

thanks

from msgpack-php.

rryqszq4 avatar rryqszq4 commented on July 19, 2024

@laruence hi:

<?php
...
$data = '';
while(true){
    $out = @socket_read($socket, 1024, PHP_NORMAL_READ);
    if ($out === false){echo "stop;";break;}
    $data.=$out;
}
var_dump($data);
$data = msgpack_unpack($data);
var_dump($data);
...

ps: lenght must be 19 ,but is 1024.

string(1024) "??hello?messagepack"
PHP Warning:  [msgpack] (php_msgpack_unserialize) Extra bytes in /develop/memwared/script/socket_client.php on line 36
array(2) {
  [0]=>
  string(5) "hello"
  [1]=>
  string(11) "messagepack"
}

from msgpack-php.

Sean-Der avatar Sean-Der commented on July 19, 2024

Hi @rryqszq4 !

Some information was lost because some of the things in $data pre unpack are not printable. Would you mind re-doing this except with this sample code instead?

<?php
...
$data = '';
while(true){
    $out = @socket_read($socket, 1024, PHP_NORMAL_READ);
    if ($out === false){echo "stop;";break;}
    $data.=$out;
}
var_dump(bin2hex($data));
...

thanks!

from msgpack-php.

Sean-Der avatar Sean-Der commented on July 19, 2024

Feel free to reopen @rryqszq4 when you have a test case.

thanks!

from msgpack-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.