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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: divinity76 at gmail dot com
New email:
PHP Version: OS:

 

 [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: Sun Aug 09 18:34:40 2020 UTC