3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo preg_replace('#<(a|h\d)[^>]*>[^<]+</\1>\K(*SKIP)(*FAIL)|test#', '{$0}', 'test Приходите в наш <a d>test</a> видеочат, бывший когда-то test\'м.testa больше нет. Забейте на <h2>test</h3> Труконф test').PHP_EOL;
Output for 4.4.9, 5.2.5 - 7.1.0
{test} Приходите в наш <a d>test</a> видеочат, бывший когда-то {test}'м.{test}a больше нет. Забейте на <h2>{test}</h3> Труконф {test}
Output for 4.3.11 - 4.4.8, 5.0.2 - 5.2.4
Warning: preg_replace(): Compilation failed: nothing to repeat at offset 27 in /in/ADXRk on line 2
Output for 5.0.0 - 5.0.1
Warning: preg_replace(): Compilation failed: nothing to repeat at offset 27 in /in/ADXRk on line 2 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ADXRk on line 2 PHP_EOL
Output for 4.3.10
Warning: Compilation failed: nothing to repeat at offset 27 in /in/ADXRk on line 2
Output for 4.3.0 - 4.3.9
Warning: Compilation failed: nothing to repeat at offset 27 in /in/ADXRk on line 2 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ADXRk on line 2 PHP_EOL