0
0
mirror of https://github.com/pmmp/ext-encoding.git synced 2025-09-30 12:32:53 +00:00
Files
ext-encoding/tests/writer/serialize-unserialize.phpt
Dylan K. Taylor eb9610a102 Split up ByteBuffer into reader & writer parts
closes #13

This prevents accidentally writing when reading is intended, and vice
versa.
It also allows specialising the APIs and constructors.
2025-09-06 17:12:57 +01:00

27 lines
492 B
PHP

--TEST--
Test that ByteBuffer serializes and unserializes correctly
--FILE--
<?php
use pmmp\encoding\ByteBufferWriter;
$buffer = new ByteBufferWriter("hello world");
$buffer2 = unserialize(serialize($buffer));
var_dump($buffer, $buffer2);
?>
--EXPECTF--
object(pmmp\encoding\ByteBufferWriter)#%d (2) {
["buffer"]=>
string(11) "hello world"
["offset"]=>
int(11)
}
object(pmmp\encoding\ByteBufferWriter)#%d (2) {
["buffer"]=>
string(11) "hello world"
["offset"]=>
int(11)
}