mirror of
https://github.com/pmmp/ext-encoding.git
synced 2025-09-30 12:32:53 +00:00
closes #13 This prevents accidentally writing when reading is intended, and vice versa. It also allows specialising the APIs and constructors.
27 lines
492 B
PHP
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)
|
|
}
|