File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / streams / stream_get_line_NUL_delimiter.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:09 2013 UTC (11 years ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--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"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>