Viewing File: /opt/alt/tests/alt-php80-pecl-msgpack_2.2.0-1.el8/tests/002.phpt

--TEST--
Check for null serialisation
--SKIPIF--
--FILE--
<?php
if(!extension_loaded('msgpack')) {
    dl('msgpack.' . PHP_SHLIB_SUFFIX);
}

function test($type, $variable) {
    $serialized = msgpack_serialize($variable);
    $unserialized = msgpack_unserialize($serialized);

    echo $type, PHP_EOL;
    echo bin2hex($serialized), PHP_EOL;
    var_dump($unserialized);
    echo $unserialized === $variable ? 'OK' : 'ERROR', PHP_EOL;
}

test('null', null);
?>
--EXPECT--
null
c0
NULL
OK
Back to Directory File Manager
<