3v4l.org

run code in 300+ PHP versions simultaneously
<?php $row = 'one //There are spaces here two '; $row = explode(PHP_EOL,$row); $row = $row[0]; preg_match('/( +)$/',$row,$matches);

preferences:
37.69 ms | 402 KiB | 5 Q