Doc #73142 [Ver->Csd]: php_strip_whitespace does not work on files with short tags
| From: | peehaa@php.net | Date: | Wed, 05 Apr 2017 19:22:22 +0000 |
| Subject: | Doc #73142 [Ver->Csd]: php_strip_whitespace does not work on files with short tags | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14588@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73142&edit=1
ID: 73142
Updated by: peehaa@php.net
Reported by: rob dot bast at gmail dot com
Summary: php_strip_whitespace does not work on files with
short tags
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: *General Issues
Operating System: Irrelevant
PHP Version: Irrelevant
-Assigned To:
+Assigned To: peehaa
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2016-09-22 10:10:33] rob dot bast at gmail dot com
I see. Thank you for clarifying that. I will relay this to the user that originally submitted an
issue to our project.
https://github.com/composer/composer/issues/5701
------------------------------------------------------------------------
[2016-09-22 09:57:19] requinix@php.net
php_strip_whitespace() respects the value of short_open_tag. If you have it disabled then the
function will not know to interpret what you are using as PHP code and will not strip the whitespace
from it.
The docs don't mention that.
------------------------------------------------------------------------
[2016-09-22 09:52:41] rob dot bast at gmail dot com
Sorry, expected result should be:
php -r 'var_dump(php_strip_whitespace("test.php"));'
Command line code:1:
string(4) "<?\n "
------------------------------------------------------------------------
[2016-09-22 09:51:24] rob dot bast at gmail dot com
Description:
------------
Using php_strip_whitespace on a file that makes use of the short tag notation <? does not result
in any whitespace being stripped (such as docblocks etc).
This could/should be explicitly mentioned in the documentation.
Test script:
---------------
<?
/**
* does not get removed
*/
Expected result:
----------------
% php -r 'var_dump(php_strip_whitespace("test.php"));'
Command line code:1:
string(7) "<?\n "
Actual result:
--------------
% php -r 'var_dump(php_strip_whitespace("test.php"));'
Command line code:1:
string(37) "<?\n\n/**\n * does not get removed\n */\n\n"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73142&edit=1