We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49f113a commit b9093d9Copy full SHA for b9093d9
buffer.cc
@@ -189,6 +189,8 @@ PHP_METHOD(ByteBuffer, discard)
189
GUARD_SIZE(objval, size);
190
191
objval->data->discard(size);
192
+
193
+ RETURN_ZVAL(getThis(), 1, 0);
194
}
195
196
PHP_METHOD(ByteBuffer, slice)
tests/012.phpt
@@ -0,0 +1,18 @@
1
+--TEST--
2
+Buffer fluent test
3
+--SKIPIF--
4
+<?php
5
+if (!extension_loaded('buffer')) {
6
+ echo 'skip';
7
+}
8
+?>
9
+--FILE--
10
11
+$buffer = new PHPinnacle\Buffer\ByteBuffer('abcd');
12
13
+echo $buffer->append('e')->bytes() . \PHP_EOL;
14
+echo $buffer->discard(1)->bytes() . \PHP_EOL;
15
16
+--EXPECT--
17
+abcde
18
+bcde
0 commit comments