1--TEST--
2ini_set auto_detect_line_endings bool
3--FILE--
4<?php
5
6ini_set("auto_detect_line_endings", "on");
7var_dump(ini_get("auto_detect_line_endings"));
8
9$filePath = __DIR__ . DIRECTORY_SEPARATOR . "auto_detect_line_endings_2.txt";
10file_put_contents($filePath, "fooBar1\rfooBar2\rfooBar3");
11
12$stdin = fopen($filePath, "r");
13var_dump(fgets($stdin));
14var_dump(fgets($stdin));
15var_dump(fgets($stdin));
16
17echo "Done\n";
18?>
19--EXPECTF--
20string(2) "on"
21string(8) "fooBar1
21"
22string(8) "fooBar2
22"
23string(7) "fooBar3"
24Done
25--CLEAN--
26<?php
27unlink(__DIR__ . DIRECTORY_SEPARATOR . "auto_detect_line_endings_2.txt");
28?>
29