3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a="a / b"; $a=preg_replace('/\//','\\',$a); echo "First version: {$a}\n"; $a=preg_replace('/\//','\\\\',$a); echo "Second version: {$a}\n"; ?>