3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "12345"; $res = []; if (preg_match_all('~(?=((\d)\d?))~', $s, $m, PREG_SET_ORDER)) { $single = []; $double = []; foreach ($m as $v) { if ($v[1] != $v[2]) { array_push($single, $v[2]); array_push($double, $v[1]); } else { array_push($single, $v[1]); } } $res = array_merge($single, $double); print_r( $res ); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.70.0080.00816.63
8.3.60.0090.00616.75
8.3.50.0070.00720.21
8.3.40.0040.01119.06
8.3.30.0100.00718.92
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.190.0090.00616.75
8.2.180.0100.00625.92
8.2.170.0170.00319.21
8.2.160.0130.00022.96
8.2.150.0000.00725.66
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0060.00321.25
8.2.110.0030.00620.39
8.2.100.0090.00318.16
8.2.90.0060.00317.84
8.2.80.0060.00319.95
8.2.70.0080.00017.75
8.2.60.0040.00417.88
8.2.50.0000.00817.75
8.2.40.0030.00519.80
8.2.30.0040.00418.14
8.2.20.0030.00520.36
8.2.10.0030.00518.30
8.2.00.0020.00719.54
8.1.280.0080.00825.92
8.1.270.0080.00823.85
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0090.00023.81
8.1.230.0120.00024.03
8.1.220.0000.00817.78
8.1.210.0030.00618.89
8.1.200.0030.00617.48
8.1.190.0030.00517.38
8.1.180.0000.00918.10
8.1.170.0080.00017.62
8.1.160.0050.00318.94
8.1.150.0050.00318.82
8.1.140.0070.00017.64
8.1.130.0020.00518.99
8.1.120.0000.00717.71
8.1.110.0030.00617.53
8.1.100.0040.00417.64
8.1.90.0050.00217.50
8.1.80.0070.00017.66
8.1.70.0030.00317.60
8.1.60.0040.00417.75
8.1.50.0050.00317.70
8.1.40.0140.01117.58
8.1.30.0200.00317.62
8.1.20.0110.01417.71
8.1.10.0250.00017.66
8.1.00.0220.00317.62
8.0.300.0080.00019.73
8.0.290.0050.00316.88
8.0.280.0000.00718.49
8.0.270.0000.00817.11
8.0.260.0030.00318.49
8.0.250.0000.00717.11
8.0.240.0000.00717.14
8.0.230.0000.00817.22
8.0.220.0070.00017.02
8.0.210.0000.00717.11
8.0.200.0030.00517.28
8.0.190.0040.00417.25
8.0.180.0040.00417.20
8.0.170.0170.00217.10
8.0.160.0170.00316.92
8.0.150.0140.00716.97
8.0.140.0150.00616.95
8.0.130.0220.00016.89
8.0.120.0160.00416.96
8.0.110.0150.00417.12
8.0.100.0170.00317.03
8.0.90.0180.00316.94
8.0.80.0160.00517.15
8.0.70.0130.00716.93
8.0.60.0170.00316.91
8.0.50.0120.00816.94
8.0.30.0120.00816.99
8.0.20.0180.00516.98
8.0.10.0170.00417.16
7.4.330.0060.00015.55
7.4.320.0030.00316.68
7.4.300.0000.00716.82
7.4.290.0020.00516.75
7.4.280.0200.00616.60
7.4.270.0190.01416.80
7.4.260.0200.00616.81
7.4.250.0200.00716.77
7.4.240.0280.00016.61
7.4.230.0210.00416.71
7.4.220.0140.00716.70
7.4.210.0140.00616.83
7.4.200.0150.00416.68
7.4.190.0120.00916.68
7.4.180.0180.00216.80
7.4.160.0150.00516.75
7.4.150.0060.01316.78
7.4.140.0160.00416.86
7.4.130.0200.00016.76
7.4.120.0200.00016.64
7.4.110.0160.00316.62
7.4.100.0120.00716.79
7.4.90.0190.00016.68
7.4.80.0110.00916.66
7.4.70.0160.00316.70
7.4.60.0190.00016.72
7.4.50.0140.00716.60
7.4.40.0140.00616.71
7.4.30.0200.00016.61
7.4.20.0200.00016.53
7.4.10.0200.00016.56
7.4.00.0140.00616.71

preferences:
46.17 ms | 401 KiB | 5 Q