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 "<strong>Is this bold?</strong>"; echo "\n"; echo $unescaped; echo "\n"; $that = compileEchoes('{{<strong>Is this bold?</strong>}}'); echo $that; echo "\n"; echo htmlentities('<strong>Is this bold?</strong>', ENT_QUOTES, 'UTF-8', false); ?>

preferences:
46.83 ms | 402 KiB | 5 Q