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));
Output for git.master, git.master_jit, rfc.property-hooks
'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;}h1{color:red;padding:10px;text-decoration:underline;}.code_sample ul{list-style-type:upper-roman;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;}'

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
36.94 ms | 402 KiB | 8 Q