1--TEST--
2Bug #49847 (exec() fails on lines larger then 4095 bytes)
3--FILE--
4<?php
5$iswin =  substr(PHP_OS, 0, 3) == "WIN";
6
7if ($iswin) {
8	$f = dirname(__FILE__) . '\\bug49847.tmp';
9	$s = str_repeat(' ', 4097);
10	$s .= '1';
11	file_put_contents($f, $s);
12	exec('type ' . $f, $output);
13} else {
14	exec("printf %4098d 1", $output);
15}
16var_dump($output);
17if ($iswin) {
18	unlink($f);
19}
20?>
21--EXPECTF--
22array(1) {
23  [0]=>
24  string(4098) "%s 1"
25}
26
27