3v4l.org

run code in 300+ PHP versions simultaneously
<?php $css=<<<CSS p.special { font: 12pt/14pt sans-serif; margin: 5px 0px 2px 25px; border: medium dashed #ff0000; background: white url( http://www.foo.com/image.gif ) repeat-x fixed top right; } /************************************************* Save with a name ending in .css such as styles.css *************************************************/ h1 { color: red; padding: 10px; text-decoration: underline; } .code_sample ul { list-style-type: upper-roman; /* LEAVE THIS BIT OUT */ margin-left: 50px; } .code_sample p { color: darkblue } a:link, a:visited, a:hover, a:active { background-color: green; color: white; padding: 10px 25px; text-align: center; text-decoration: none; display: inline-block; } CSS; $patterns=[ '~\s+~', // reduce one or more consecutive whitespace characters ([\n\r \t]+) to a single space ...this combines the 2nd, 3rd, and 4th pattern from catchamonkey's answer '~/\s*\*.*?\*/\s*|(?:(?<=[,:;{}(]) | (?=[,:;{})]))|;(?=})|^ | $~s' // comment blocks, leading/trailing spaces after ,:;{} characters, space before ), space after (, semicolon followed by }, whitespace at start/end of file ]; $replacements=[ ' ', '' ]; // And here's a rabbit hole: https://regex101.com/r/nZbHND/1 var_export(preg_replace($patterns,$replacements,$css));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fL9aH
function name:  (null)
number of ops:  12
compiled vars:  !0 = $css, !1 = $patterns, !2 = $replacements
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '++++p.special+%7B%0A+++++++++++++++++font%3A+12pt%2F14pt+sans-serif%3B%0A+++++++++++++++++margin%3A+5px+0px+2px+25px%3B%0A+++++++++++++++++border%3A+medium+dashed+%23ff0000%3B%0A+++++++++++++++++background%3A+white+url%28+http%3A%2F%2Fwww.foo.com%2Fimage.gif+%29+repeat-x+fixed+top+right%3B+%7D%0A+++++++++++++++++%0A+++++++++++++++++%2F%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A+%0ASave+with+a+name+ending+in+.css+such+as+styles.css+%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2F%0A%0Ah1+%7B%0A%09color%3A+red%3B+padding%3A+10px%3B+text-decoration%3A+underline%3B%0A%7D%0A%0A.code_sample+ul+%7B%0A++++++++list-style-type%3A+upper-roman%3B++%2F%2A+LEAVE+THIS+BIT+OUT+%2A%2F%0A++++++++margin-left%3A+50px%3B%0A%7D%0A.code_sample+p+%7B%0A++++color%3A+darkblue%0A%7D%0A%0Aa%3Alink%2C+a%3Avisited%2C+a%3Ahover%2C+a%3Aactive+%7B%0A++background-color%3A+green%3B%0A++color%3A+white%3B%0A++padding%3A+10px+25px%3B%0A++text-align%3A+center%3B%0A++text-decoration%3A+none%3B%0A++display%3A+inline-block%3B%0A%7D'
   34     1        ASSIGN                                                   !1, <array>
   39     2        ASSIGN                                                   !2, <array>
   46     3        INIT_FCALL                                               'var_export'
          4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.89 ms | 940 KiB | 18 Q