3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "I need to replace = in string with == sign, but not in <=, != and >= signs."; echo preg_replace('/(?<![<>=!])=(?!=)/', '==', $string);

preferences:
28.93 ms | 404 KiB | 5 Q