php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #33419 Strings as input for php_strip_whitespace()
Submitted: 2005-06-21 11:21 UTC Modified: 2021-02-23 15:35 UTC
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: sebastian@php.net Assigned:
Status: Suspended Package: Unknown/Other Function
PHP Version: 5CVS-2005-06-21 (dev) OS: Irrelevant
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: sebastian@php.net
New email:
PHP Version: OS:

 

 [2005-06-21 11:21 UTC] sebastian@php.net
Description:
------------
Could php_strip_whitespace() be changed to work on strings, too?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-21 12:38 UTC] johannes@php.net
A patch adding a php_string_strip_whitespace() function  
(what a great name!) is at  
http://www.schlueters.de/php_string_strip_whitespace.diff  
 [2007-06-09 22:41 UTC] henke at henke37 dot cjb dot net
The patch file is a 404 now.
 [2016-12-30 22:55 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Unknown/Other Function
 [2020-10-11 12:20 UTC] divinity76 at gmail dot com
in case someone is looking for a quick workaround though,

<?php
function php_strip_whitespace_string(string $code):string{
    $h = tmpfile();
    fwrite($h, $code);
    $ret = php_strip_whitespace(stream_get_meta_data($h)['uri']);
    fclose($h);
    return $ret;
}
?>
 [2021-02-23 15:35 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2021-02-23 15:35 UTC] cmb@php.net
If anybody is still interested in this feature, please pursue the
RFC process[1].  For the time being, I'm suspending this ticket.

[1] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 13:01:29 2025 UTC