3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(?:^PING\b[^(]*\(([^)]*)\)\s([^.]*)\.|\G(?!^))\R(\d+\sbytes).*?icmp_seq=(\d+)\h+ttl=(\d+).*?time=(\d+(?:\.\d+)?\h+ms).*(?:\s+---.*\R(\d+)\spackets\stransmitted.*?(\d+)\sreceived,\h*(\d+%)\spacket\sloss,\h+time\s(\d+ms)\R.*=\s(\d+(?:\.\d+)?)\/(\d+(?:\.\d+)?)\/(\d+(?:\.\d+)?)\/(\d+(?:\.\d+)?)\sms)?/'; $str = 'PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data. 64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=0.816 ms 64 bytes from 1.1.1.1: icmp_seq=2 ttl=58 time=0.883 ms 64 bytes from 1.1.1.1: icmp_seq=3 ttl=58 time=0.743 ms 64 bytes from 1.1.1.1: icmp_seq=4 ttl=58 time=0.613 ms --- 1.1.1.1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3033ms rtt min/avg/max/mdev = 0.613/0.763/0.883/0.105 ms '; preg_match_all($re, $str, $matches); var_dump($matches);

preferences:
19.69 ms | 405 KiB | 5 Q