1
0
mirror of https://github.com/msgpack/msgpack-c.git synced 2025-03-21 15:10:01 +01:00
2010-07-17 18:46:28 +09:00

27 lines
489 B
PHP

--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