|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53622 CLI -w separate functions of striping whitespace and comments
Submitted: 2010-12-28 17:44 UTC Modified: 2011-01-05 15:50 UTC
From: mnelson at teshy dot com Assigned:
Status: Wont fix Package: CGI/CLI related
PHP Version: 5.3.4 OS: all
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-12-28 17:44 UTC] mnelson at teshy dot com
It would be useful if The Command line option "-w" for stripping comments and 
whitespace was broken down into separate commands. One for striping whitespace and 
one for striping comments, the commands could be combined for users that want 

In our use case we have code that has become unreadable and needs excessive 
whitespace removed so it can be reformatted properly, we however want to keep all 
code comments.


strip-comments-whitespace (last revision 2011-01-04 15:01 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 01:57 UTC]
I believe it is better to do this in userland. I'd actually drop the -w flag completely. Keeping the bug open so people can disagree and implement it :-)

btw. a userspace beautifier is on
 [2011-01-04 16:01 UTC]
The following patch has been added/updated:

Patch Name: strip-comments-whitespace
Revision:   1294153279
 [2011-01-04 16:01 UTC]
I tend to agree, but I implemented it anyway. :)

Quick and dirty patch against trunk attached.
 [2011-01-04 17:50 UTC]
I didn't test the patch but two comments: The simple one is that the documentation in the man page is missing.

The more complex one is around single line comments. T_COMMENT includes the trailing new line. So I assume that

// some comment

would become


Such issues make me believe more and more in specialized tools like mentioned above :-)
 [2011-01-05 15:50 UTC]
-Status: Open +Status: Wont fix
 [2011-01-05 15:50 UTC]
Won't fix, per discussion on IRC. As Johannes says, it's better left to third 
party tools.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Dec 01 06:01:23 2020 UTC