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";
Output for 8.3.5 - 8.3.28, 8.4.9 - 8.4.15, 8.5.0
NO REPLACEMENTS 2 REPLACEMENTS

preferences:
48.92 ms | 406 KiB | 5 Q