3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'This is the string number 123-45-6789-0 which contains 12-34567.'; echo preg_replace_callback('~\d+(?:-\d+)+~', function($m) { return implode('-', array_reverse(explode('-', $m[0]))); } ,$str);

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.60.0090.00916.75
8.3.50.0090.00918.48
8.3.40.0100.01319.09
8.3.30.0120.00319.34
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0080.00026.16
8.2.180.0140.00025.92
8.2.170.0110.00722.96
8.2.160.0090.00622.96
8.2.150.0050.00325.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0000.00826.35
8.2.110.0090.00022.38
8.2.100.0040.00818.22
8.2.90.0060.00318.00
8.2.80.0030.00518.86
8.2.70.0040.00417.88
8.2.60.0000.00817.93
8.2.50.0000.01018.07
8.2.40.0040.00418.29
8.2.30.0080.00018.22
8.2.20.0040.00418.04
8.2.10.0050.00219.21
8.2.00.0050.00219.32
8.1.280.0070.00725.92
8.1.270.0060.01320.40
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0090.00022.14
8.1.230.0070.00419.09
8.1.220.0080.00017.76
8.1.210.0060.00318.77
8.1.200.0050.00317.50
8.1.190.0000.00917.25
8.1.180.0040.00418.10
8.1.170.0090.00018.71
8.1.160.0080.00018.79
8.1.150.0040.00418.92
8.1.140.0000.00718.88
8.1.130.0070.00020.17
8.1.120.0030.00617.68
8.1.110.0070.00017.46
8.1.100.0040.00417.68
8.1.90.0000.00817.59
8.1.80.0060.00317.51
8.1.70.0040.00417.64
8.1.60.0050.00317.79
8.1.50.0030.00517.70
8.1.40.0080.00017.72
8.1.30.0030.00617.84
8.1.20.0000.00917.73
8.1.10.0000.00817.78
8.1.00.0030.00717.68
8.0.300.0040.00421.64
8.0.290.0060.00316.88
8.0.280.0030.00318.36
8.0.270.0030.00318.17
8.0.260.0060.00018.49
8.0.250.0000.00717.11
8.0.240.0040.00417.12
8.0.230.0000.00717.10
8.0.220.0000.00716.88
8.0.210.0000.00816.98
8.0.200.0000.00717.07
8.0.190.0000.00716.98
8.0.180.0040.00416.95
8.0.170.0030.00517.05
8.0.160.0040.00417.13
8.0.150.0040.00417.00
8.0.140.0030.00516.89
8.0.130.0030.00313.44
8.0.120.0040.00416.90
8.0.110.0050.00317.00
8.0.100.0000.00817.11
8.0.90.0040.00416.99
8.0.80.0090.01017.07
8.0.70.0070.00016.98
8.0.60.0040.00417.11
8.0.50.0040.00417.11
8.0.30.0080.00817.06
8.0.20.0130.00617.52
8.0.10.0000.00717.19
8.0.00.0190.00616.80
7.4.330.0040.00015.55
7.4.320.0030.00316.75
7.4.300.0060.00016.78
7.4.290.0000.00716.80
7.4.280.0050.00316.72
7.4.270.0070.00016.81
7.4.260.0020.00213.54
7.4.250.0070.00016.80
7.4.240.0020.00516.68
7.4.230.0000.00716.86
7.4.220.0020.00616.63
7.4.210.0090.01016.78
7.4.200.0050.00216.80
7.4.130.0100.00716.74
7.4.120.0110.00616.62
7.4.110.0130.00316.71
7.4.100.0180.00016.78
7.4.90.0140.00816.77
7.4.80.0060.01019.39
7.4.70.0030.01316.67
7.4.60.0090.01216.66
7.4.50.0110.00616.65
7.4.40.0090.00916.72
7.4.30.0100.00716.59
7.4.20.0120.00316.69
7.4.10.0000.01616.63
7.4.00.0100.00716.61
7.3.330.0000.00716.43
7.3.320.0030.00313.46
7.3.310.0030.00316.52
7.3.300.0040.00416.43
7.3.290.0070.00816.41
7.3.260.0060.01016.52
7.3.240.0090.00716.61
7.3.230.0140.00316.54
7.3.210.0140.00316.45
7.3.200.0120.00816.66
7.3.190.0130.00316.46
7.3.180.0080.00816.71
7.3.170.0030.01616.30
7.3.160.0120.00616.45
7.3.150.0130.00316.62
7.3.140.0120.00616.47
7.3.130.0080.00816.48
7.3.120.0120.00716.45
7.3.110.0080.00716.58
7.3.100.0130.00716.70
7.3.90.0070.01016.52
7.3.80.0070.01116.60
7.3.70.0060.01416.46
7.3.60.0040.01516.48
7.3.50.0130.00716.48
7.3.40.0030.01516.51
7.3.30.0090.00616.43
7.3.20.0080.00816.57
7.3.10.0080.01116.49
7.3.00.0090.00916.56
7.2.330.0110.01316.86
7.2.310.0120.00916.64
7.2.300.0070.01316.76
7.2.290.0090.00916.60
7.2.280.0070.01016.72
7.2.270.0030.01316.88
7.2.260.0090.00816.69
7.2.250.0160.00016.82
7.2.240.0070.01016.80
7.2.230.0150.00316.70
7.2.220.0140.00416.73
7.2.210.0030.01316.71
7.2.200.0080.00816.84
7.2.190.0090.00616.59
7.2.180.0130.00316.62
7.2.170.0030.01516.61
7.2.160.0100.00616.52
7.2.150.0100.00716.76
7.2.140.0040.01516.70
7.2.130.0140.00316.67
7.2.120.0000.01716.82
7.2.110.0170.00016.73
7.2.100.0070.01016.77
7.2.90.0090.00916.86
7.2.80.0160.00316.85
7.2.70.0100.00716.72
7.2.60.0070.01016.67
7.2.50.0100.00716.82
7.2.40.0070.01016.86
7.2.30.0070.01016.81
7.2.20.0110.00716.82
7.2.10.0070.01016.71
7.2.00.0060.01216.66

preferences:
68.9 ms | 401 KiB | 5 Q