3v4l.org

run code in 300+ PHP versions simultaneously
<?php $before = 'abca'; $after = preg_replace( '/a/', 'a', $before, -1, $count ); if ( $after === $before ) { echo "NO REPLACEMENTS" . PHP_EOL; } echo $count . " REPLACEMENTS";

preferences:
26.04 ms | 404 KiB | 5 Q