0
0
mirror of https://github.com/pmmp/ext-encoding.git synced 2025-09-21 09:19:44 +00:00
Files
ext-encoding/tests/reader/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
496 B
PHP

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