note 123863 added to function.php-strip-whitespace
| From: | razvan_bc.yahoo.com via php-notes | Date: | Mon, 20 May 2019 11:48:03 +0000 |
| Subject: | note 123863 added to function.php-strip-whitespace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-211090@lists.php.net to get a copy of this message | ||
i notice that on 45=75kb php file compressed using php_strip_whitespace i got slowest speed results
in my apache benchmark .bat tests so doing on a normal php file 10 tests and another 10 tests on a
compressed one ,calculating the math average value I got fastest results on normal php files.
well,seeing that results i think SO ,NICE,BUT IF WE COMBINE THESE "METHODS" : what if i
use a partial minified method using this function ????
here is the code:
(if you run this in xampp and you are beginner you got a blank page in firefox ,but if you right
click it then you click on the option "view source" you'll get the php partial
stripped by comments and tabs) :
<?php
/* hi there !!!
here are the comments */
//another try
echo removecomments('index.php');
/* hi there !!!
here are the comments */
//another try
function removecomments($f){
$w=Array(';','{','}');
$ts = token_get_all(php_strip_whitespace($f));
$s='';
foreach($ts as $t){
if(is_array($t)){
$s .=$t[1];
}else{
$s .=$t;
if( in_array($t,$w) ) $s.=chr(13).chr(10);
}
}
return $s;
}
?>
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.195 (proxied: 82.137.13.52)
----
Manual Page -- http://php.net/manual/en/function.php-strip-whitespace.php
Edit -- https://master.php.net/note/edit/123863
Del: integrated -- https://master.php.net/note/delete/123863/integrated
Del: useless -- https://master.php.net/note/delete/123863/useless
Del: bad code -- https://master.php.net/note/delete/123863/bad+code
Del: spam -- https://master.php.net/note/delete/123863/spam
Del: non-english -- https://master.php.net/note/delete/123863/non-english
Del: in docs -- https://master.php.net/note/delete/123863/in+docs
Del: other reasons-- https://master.php.net/note/delete/123863
Reject -- https://master.php.net/note/reject/123863
Search -- https://master.php.net/manage/user-notes.php