3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = <<<CSS /* Language specific height correction for titles. Ref T31405 and T32809 */ /* Languages like hi or ml require slightly more vertical space to show diacritics properly */ h1:lang( anp ), h1:lang( as ), h1:lang( bh ), /* Macrolanguage, used on bh.wikipedia.org, should be removed one day */ h1:lang( bho ), h1:lang( bn ), h1:lang( gu ), h1:lang( hi ), h1:lang( kn ), h1:lang( ks ), h1:lang( ml ), h1:lang( mr ), h1:lang( my ), h1:lang( mai ), h1:lang( ne ), h1:lang( new ), h1:lang( or ), h1:lang( pa ), h1:lang( pi ), h1:lang( sa ), h1:lang( ta ), h1:lang( te ) { line-height: 1.6em !important; /* stylelint-disable-line declaration-no-important */ } /* stylelint-disable selector-list-comma-newline-after */ h2:lang( anp ), h3:lang( anp ), h4:lang( anp ), h5:lang( anp ), h6:lang( anp ), h2:lang( as ), h3:lang( as ), h4:lang( as ), h5:lang( as ), h6:lang( as ), h2:lang( bho ), h3:lang( bho ), h4:lang( bho ), h5:lang( bho ), h6:lang( bho ), h2:lang( bh ), h3:lang( bh ), h4:lang( bh ), h5:lang( bh ), h6:lang( bh ), h2:lang( bn ), h3:lang( bn ), h4:lang( bn ), h5:lang( bn ), h6:lang( bn ), h2:lang( gu ), h3:lang( gu ), h4:lang( gu ), h5:lang( gu ), h6:lang( gu ), h2:lang( hi ), h3:lang( hi ), h4:lang( hi ), h5:lang( hi ), h6:lang( hi ), h2:lang( kn ), h3:lang( kn ), h4:lang( kn ), h5:lang( kn ), h6:lang( kn ), h2:lang( ks ), h3:lang( ks ), h4:lang( ks ), h5:lang( ks ), h6:lang( ks ), h2:lang( ml ), h3:lang( ml ), h4:lang( ml ), h5:lang( ml ), h6:lang( ml ), h2:lang( mr ), h3:lang( mr ), h4:lang( mr ), h5:lang( mr ), h6:lang( mr ), h2:lang( my ), h3:lang( my ), h4:lang( my ), h5:lang( my ), h6:lang( my ), h2:lang( mai ), h3:lang( mai ), h4:lang( mai ), h5:lang( mai ), h6:lang( mai ), h2:lang( ne ), h3:lang( ne ), h4:lang( ne ), h5:lang( ne ), h6:lang( ne ), h2:lang( new ), h3:lang( new ), h4:lang( new ), h5:lang( new ), h6:lang( new ), h2:lang( or ), h3:lang( or ), h4:lang( or ), h5:lang( or ), h6:lang( or ), h2:lang( pa ), h3:lang( pa ), h4:lang( pa ), h5:lang( pa ), h6:lang( pa ), h2:lang( pi ), h3:lang( pi ), h4:lang( pi ), h5:lang( pi ), h6:lang( pi ), h2:lang( sa ), h3:lang( sa ), h4:lang( sa ), h5:lang( sa ), h6:lang( sa ), h2:lang( ta ), h3:lang( ta ), h4:lang( ta ), h5:lang( ta ), h6:lang( ta ), h2:lang( te ), h3:lang( te ), h4:lang( te ), h5:lang( te ), h6:lang( te ) { line-height: 1.2em; } /* stylelint-enable selector-list-comma-newline-after */ CSS; class CSSMin { public static function minify( $css ) { return trim( str_replace( [ '; ', ': ', ' {', '{ ', ', ', '} ', ';}', '( ', ' )', '[ ', ' ]' ], [ ';', ':', '{', '{', ',', '}', '}', '(', ')', '[', ']' ], preg_replace( [ '/\s+/', '/\/\*.*?\*\//s' ], [ ' ', '' ], $css ) ) ); } } $min = CSSMin::minify($input); $minz = gzdeflate($min, 9); echo "transfer size: " . strlen($minz) . "\n"; echo "decompressed: " . strlen($min) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3krEo
function name:  (null)
number of ops:  19
compiled vars:  !0 = $input, !1 = $min, !2 = $minz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%2A+Language+specific+height+correction+for+titles.+Ref+T31405+and+T32809+%2A%2F%0A%2F%2A+Languages+like+hi+or+ml+require+slightly+more+vertical+space+to+show+diacritics+properly+%2A%2F%0Ah1%3Alang%28+anp+%29%2C%0Ah1%3Alang%28+as+%29%2C%0Ah1%3Alang%28+bh+%29%2C+%2F%2A+Macrolanguage%2C+used+on+bh.wikipedia.org%2C+should+be+removed+one+day+%2A%2F%0Ah1%3Alang%28+bho+%29%2C%0Ah1%3Alang%28+bn+%29%2C%0Ah1%3Alang%28+gu+%29%2C%0Ah1%3Alang%28+hi+%29%2C%0Ah1%3Alang%28+kn+%29%2C%0Ah1%3Alang%28+ks+%29%2C%0Ah1%3Alang%28+ml+%29%2C%0Ah1%3Alang%28+mr+%29%2C%0Ah1%3Alang%28+my+%29%2C%0Ah1%3Alang%28+mai+%29%2C%0Ah1%3Alang%28+ne+%29%2C%0Ah1%3Alang%28+new+%29%2C%0Ah1%3Alang%28+or+%29%2C%0Ah1%3Alang%28+pa+%29%2C%0Ah1%3Alang%28+pi+%29%2C%0Ah1%3Alang%28+sa+%29%2C%0Ah1%3Alang%28+ta+%29%2C%0Ah1%3Alang%28+te+%29+%7B%0A%09line-height%3A+1.6em+%21important%3B+%2F%2A+stylelint-disable-line+declaration-no-important+%2A%2F%0A%7D%0A%0A%2F%2A+stylelint-disable+selector-list-comma-newline-after+%2A%2F%0Ah2%3Alang%28+anp+%29%2C+h3%3Alang%28+anp+%29%2C+h4%3Alang%28+anp+%29%2C+h5%3Alang%28+anp+%29%2C+h6%3Alang%28+anp+%29%2C%0Ah2%3Alang%28+as+%29%2C+h3%3Alang%28+as+%29%2C+h4%3Alang%28+as+%29%2C+h5%3Alang%28+as+%29%2C+h6%3Alang%28+as+%29%2C%0Ah2%3Alang%28+bho+%29%2C+h3%3Alang%28+bho+%29%2C+h4%3Alang%28+bho+%29%2C+h5%3Alang%28+bho+%29%2C+h6%3Alang%28+bho+%29%2C%0Ah2%3Alang%28+bh+%29%2C+h3%3Alang%28+bh+%29%2C+h4%3Alang%28+bh+%29%2C+h5%3Alang%28+bh+%29%2C+h6%3Alang%28+bh+%29%2C%0Ah2%3Alang%28+bn+%29%2C+h3%3Alang%28+bn+%29%2C+h4%3Alang%28+bn+%29%2C+h5%3Alang%28+bn+%29%2C+h6%3Alang%28+bn+%29%2C%0Ah2%3Alang%28+gu+%29%2C+h3%3Alang%28+gu+%29%2C+h4%3Alang%28+gu+%29%2C+h5%3Alang%28+gu+%29%2C+h6%3Alang%28+gu+%29%2C%0Ah2%3Alang%28+hi+%29%2C+h3%3Alang%28+hi+%29%2C+h4%3Alang%28+hi+%29%2C+h5%3Alang%28+hi+%29%2C+h6%3Alang%28+hi+%29%2C%0Ah2%3Alang%28+kn+%29%2C+h3%3Alang%28+kn+%29%2C+h4%3Alang%28+kn+%29%2C+h5%3Alang%28+kn+%29%2C+h6%3Alang%28+kn+%29%2C%0Ah2%3Alang%28+ks+%29%2C+h3%3Alang%28+ks+%29%2C+h4%3Alang%28+ks+%29%2C+h5%3Alang%28+ks+%29%2C+h6%3Alang%28+ks+%29%2C%0Ah2%3Alang%28+ml+%29%2C+h3%3Alang%28+ml+%29%2C+h4%3Alang%28+ml+%29%2C+h5%3Alang%28+ml+%29%2C+h6%3Alang%28+ml+%29%2C%0Ah2%3Alang%28+mr+%29%2C+h3%3Alang%28+mr+%29%2C+h4%3Alang%28+mr+%29%2C+h5%3Alang%28+mr+%29%2C+h6%3Alang%28+mr+%29%2C%0Ah2%3Alang%28+my+%29%2C+h3%3Alang%28+my+%29%2C+h4%3Alang%28+my+%29%2C+h5%3Alang%28+my+%29%2C+h6%3Alang%28+my+%29%2C%0Ah2%3Alang%28+mai+%29%2C+h3%3Alang%28+mai+%29%2C+h4%3Alang%28+mai+%29%2C+h5%3Alang%28+mai+%29%2C+h6%3Alang%28+mai+%29%2C%0Ah2%3Alang%28+ne+%29%2C+h3%3Alang%28+ne+%29%2C+h4%3Alang%28+ne+%29%2C+h5%3Alang%28+ne+%29%2C+h6%3Alang%28+ne+%29%2C%0Ah2%3Alang%28+new+%29%2C+h3%3Alang%28+new+%29%2C+h4%3Alang%28+new+%29%2C+h5%3Alang%28+new+%29%2C+h6%3Alang%28+new+%29%2C%0Ah2%3Alang%28+or+%29%2C+h3%3Alang%28+or+%29%2C+h4%3Alang%28+or+%29%2C+h5%3Alang%28+or+%29%2C+h6%3Alang%28+or+%29%2C%0Ah2%3Alang%28+pa+%29%2C+h3%3Alang%28+pa+%29%2C+h4%3Alang%28+pa+%29%2C+h5%3Alang%28+pa+%29%2C+h6%3Alang%28+pa+%29%2C%0Ah2%3Alang%28+pi+%29%2C+h3%3Alang%28+pi+%29%2C+h4%3Alang%28+pi+%29%2C+h5%3Alang%28+pi+%29%2C+h6%3Alang%28+pi+%29%2C%0Ah2%3Alang%28+sa+%29%2C+h3%3Alang%28+sa+%29%2C+h4%3Alang%28+sa+%29%2C+h5%3Alang%28+sa+%29%2C+h6%3Alang%28+sa+%29%2C%0Ah2%3Alang%28+ta+%29%2C+h3%3Alang%28+ta+%29%2C+h4%3Alang%28+ta+%29%2C+h5%3Alang%28+ta+%29%2C+h6%3Alang%28+ta+%29%2C%0Ah2%3Alang%28+te+%29%2C+h3%3Alang%28+te+%29%2C+h4%3Alang%28+te+%29%2C+h5%3Alang%28+te+%29%2C+h6%3Alang%28+te+%29+%7B%0A%09line-height%3A+1.2em%3B%0A%7D%0A%2F%2A+stylelint-enable+selector-list-comma-newline-after+%2A%2F'
   70     1        INIT_STATIC_METHOD_CALL                                  'CSSMin', 'minify'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   71     5        INIT_FCALL                                               'gzdeflate'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 9
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
   73    10        STRLEN                                           ~8      !2
         11        CONCAT                                           ~9      'transfer+size%3A+', ~8
         12        CONCAT                                           ~10     ~9, '%0A'
         13        ECHO                                                     ~10
   74    14        STRLEN                                           ~11     !1
         15        CONCAT                                           ~12     'decompressed%3A+', ~11
         16        CONCAT                                           ~13     ~12, '%0A'
         17        ECHO                                                     ~13
         18      > RETURN                                                   1

Class CSSMin:
Function minify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3krEo
function name:  minify
number of ops:  16
compiled vars:  !0 = $css
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   RECV                                             !0      
   59     1        INIT_FCALL                                               'trim'
   60     2        INIT_FCALL                                               'str_replace'
   61     3        SEND_VAL                                                 <array>
   62     4        SEND_VAL                                                 <array>
   63     5        INIT_FCALL                                               'preg_replace'
          6        SEND_VAL                                                 <array>
          7        SEND_VAL                                                 <array>
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $1      
         10        SEND_VAR                                                 $1
   60    11        DO_ICALL                                         $2      
   63    12        SEND_VAR                                                 $2
   59    13        DO_ICALL                                         $3      
   63    14      > RETURN                                                   $3
   66    15*     > RETURN                                                   null

End of function minify

End of class CSSMin.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.22 ms | 1467 KiB | 17 Q