- assert: documentation ( source)
- var_dump: documentation ( source)
- ini_set: documentation ( source)
- ini_get: documentation ( source)
- fwrite: documentation ( source)
- fseek: documentation ( source)
- fopen: documentation ( source)
<?php
$tmp = fopen('php://temp', 'rw');
fwrite($tmp, "Hi\n");
fwrite($tmp, "I am a creature\r\n");
fwrite($tmp, "from your dreams\r");
fwrite($tmp, "stop\n");
fseek($tmp, 0);
var_dump(ini_get('auto_detect_line_endings'));
ini_set("auto_detect_line_endings", true);
assert('fgets($tmp) === "Hi\n";');
assert('fgets($tmp) === "I am a creature\r\n";');
assert('fgets($tmp) === "from your dreams\r";');