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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 09:01:34 2025 UTC