summaryrefslogtreecommitdiff
path: root/ext/standard/tests/streams
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2012-04-07 16:34:17 +0100
committerGustavo André dos Santos Lopes <cataphract@php.net>2012-04-07 16:34:17 +0100
commitf7d407678570f8e4063b70bd30f3fc19c10442ea (patch)
tree323784651013e8a2dbc3e62ee41990c93d0fc788 /ext/standard/tests/streams
parent014ed76943071d674cdc308f28b74be18e1caf0c (diff)
parent0f180a63ebb2d65bbe49b68d2430639b20443e9a (diff)
downloadphp-git-f7d407678570f8e4063b70bd30f3fc19c10442ea.tar.gz
Merge branch '5.3' into 5.4
Diffstat (limited to 'ext/standard/tests/streams')
-rw-r--r--ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt b/ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt
new file mode 100644
index 0000000000..32756d7618
--- /dev/null
+++ b/ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #60455: stream_get_line and \0 as a delimiter
+--FILE--
+<?php
+class TestStream {
+ private $s = 0;
+ function stream_open($path, $mode, $options, &$opened_path) {
+ return true;
+ }
+ function stream_read($count) {
+ if ($this->s++ == 0)
+ return "a\0";
+
+ return "";
+ }
+ function stream_eof() {
+ return $this->s >= 2;
+ }
+
+}
+
+stream_wrapper_register("test", "TestStream");
+
+$f = fopen("test://", "r");
+var_dump(stream_get_line($f, 100, "\0"));
+--EXPECT--
+string(1) "a"