3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ '8x10 frame', '8*10 frame', '8 * 10 frame', '8 x 10 frame', '8x10 photo frame' ]; var_export(preg_replace('~\d\K ?[x*] ?(?=\d)~i', ' x ', $strings));

preferences:
147.53 ms | 405 KiB | 5 Q