3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'Wires: 8 Pairs: 4'; echo preg_replace_callback( '/Wires: (\d+) Pairs: (\d+)/', fn($m) => sprintf( 'Wires: %d Pairs: %d', $m[1] / $m[2], $m[2] ), $input );

preferences:
27.29 ms | 405 KiB | 5 Q