3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // ... $zaznam = <<<ZAZNAM Toto je nejaký kurva piča záznam s nejakým prázdnym <p></P> odstavcom zalomenie <p></p> viac zalomeni aj v odstavci <p> </p> Dlhý text dlhý text <p> </p> Vykonaj <p>toto</p> ZAZNAM; // RegExp pre prázdny odstavec $regexp_emptyParagrahp = "~[\s\r\n]*<p>[\s\r\n]*</p>[\s\r\n]*~gi"; // odstránenie všetkých prázdnych odstavcov pomocou PHP PCRE $zaznam = preg_replace($regexp_emptyParagraph, "\n<br>\n", $zaznam); // robím niečo so záznamom // ... echo $zaznam; exit;
Output for 5.0.4 - 5.1.1, 5.1.3 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: regexp_emptyParagraph in /in/EtLma on line 28 Warning: preg_replace(): Empty regular expression in /in/EtLma on line 28
Output for hhvm-3.10.0 - 3.13.2
Notice: Undefined variable: regexp_emptyParagraph in /in/EtLma on line 28 Warning: Empty regular expression in /in/EtLma on line 28
Output for 5.1.2
Notice: Undefined variable: regexp_emptyParagraph in /in/EtLma on line 29 Warning: preg_replace(): Empty regular expression in /in/EtLma on line 29
Output for 4.3.11 - 4.4.1, 4.4.3 - 5.0.3
Notice: Undefined variable: regexp_emptyParagraph in /in/EtLma on line 28 Warning: preg_replace(): Empty regular expression in /in/EtLma on line 28
Output for 4.4.2
Notice: Undefined variable: regexp_emptyParagraph in /in/EtLma on line 29 Warning: preg_replace(): Empty regular expression in /in/EtLma on line 29
Output for 4.3.0 - 4.3.10
Notice: Undefined variable: regexp_emptyParagraph in /in/EtLma on line 28 Warning: Empty regular expression in /in/EtLma on line 28