3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compileEchoes($value){ $value = preg_replace ('/\{\{\{\s*(.+?)\s*\}\}\}/s', '<?php echo $1; ?>', $value); return preg_replace ('/\{\{\s*(.+?)\s*\}\}/s', "<?php echo htmlentities($1, ENT_QUOTES, 'UTF-8', false); ?>", $value); } $unescaped = compileEchoes('{{{<strong>Is this bold?</strong>}}}'); echo $unescaped; echo "\n"; $that = compileEchoes('{{<strong>Is this bold?</strong>}}'); echo $that.'\n'; echo htmlentities('<strong>Is this bold?</strong>', ENT_QUOTES, 'UTF-8', false); ?>

preferences:
33.54 ms | 402 KiB | 5 Q