3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url_list = [ 'http://i.imgur.com/4ReyOhl', 'http://i.imgur.com/4ReyOh2.jpg', 'http://i.imgur.com/4ReyOh3' ]; var_export( preg_replace("/(?<!\.jpg)$/", ".jpg", $url_list) );
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
array ( 0 => 'http://i.imgur.com/4ReyOhl.jpg', 1 => 'http://i.imgur.com/4ReyOh2.jpg', 2 => 'http://i.imgur.com/4ReyOh3.jpg', )

preferences:
70.07 ms | 402 KiB | 91 Q