3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = preg_replace('/\s+(?=(\d\s*){0,3}$)/', '', '12895 6 7 8 9'); echo "$text\n"; $text = preg_replace('/\s+(?=(\d\s*){0,3}$)/', '', '2546734 34 55'); echo "$text\n"; $text = preg_replace('/\s+(?=(\d\s*){0,3}$)/', '', '2334734556 341 5'); echo "$text\n"; $text = preg_replace('/\s+(?=(\d\s*){0,3}$)/', '', '23347345563 4 1 5'); echo "$text\n";

preferences:
33.02 ms | 404 KiB | 5 Q