php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76320 fail to print carraige-return after end tag in included file
Submitted: 2018-05-09 18:51 UTC Modified: 2018-05-09 19:03 UTC
From: divinity76 at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 7.2.5 OS:
Private report: No CVE-ID: None
 [2018-05-09 18:51 UTC] divinity76 at gmail dot com
Description:
------------
http://php.net/manual/en/language.basic-syntax.phpmode.php says "when the PHP interpreter hits the ?> closing tags, it simply starts outputting whatever it finds (except for an immediately following newline - see instruction separation) until it hits another opening tag", but it seems a carriage return character is also not printed, if encountered. but it is apparently not documented. (ps, i tested this both on a linux system and a windows system, the result is the same on both.)

Test script:
---------------
<?php
$tmp=tmpfile();
fwrite($tmp,"<?php ?>\r");
ob_start();
require(stream_get_meta_data($tmp)['uri']);
var_dump(bin2hex(ob_get_clean()));



Expected result:
----------------
string(2) "0d"

Actual result:
--------------
string(0) ""

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-09 19:03 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2018-05-09 19:03 UTC] requinix@php.net
\r is an old Mac newline.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 23 23:01:23 2020 UTC