3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $source = <<<HTML [nav id="1"] [nav id="2"] [nav id="текстовоезначение"] HTML; $source = preg_replace( "#\\[nav id=\"(.+?)\"\\]#is", "<span id=\"\\1\"></span>", $source ); echo $source . PHP_EOL . PHP_EOL; $source = preg_replace( "#<span id=\"(.+?)\"></span>#", "[nav id=\"\\1\"]", $source ); echo $source;
based on rcIeY
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.30, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.3.0beta1
<span id="1"></span> <span id="2"></span> <span id="текстовоезначение"></span> [nav id="1"] [nav id="2"] [nav id="текстовоезначение"]
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VAdQ6 on line 11 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VAdQ6 on line 11 <span id="1"></span> <span id="2"></span> <span id="текстовоезначение"></span>PHP_EOLPHP_EOL[nav id="1"] [nav id="2"] [nav id="текстовоезначение"]