3v4l.org

run code in 300+ PHP versions simultaneously
<?php $txt = "He *is* a good boy. How *are* you."; $_GET['one'] = "doesn't"; $_GET['two'] = "think about"; preg_match_all( '{\*[^*]+\*}',$txt,$matches ); $txt = str_replace( $matches[0][0], $_GET['one'], $txt ); $txt = str_replace( $matches[0][1], $_GET['two'], $txt ); echo $txt;
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
He doesn't a good boy. How think about you.

preferences:
84.21 ms | 402 KiB | 89 Q