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.2.10.0050.00219.21
8.2.00.0050.00219.32
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.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:
16.94 ms | 403 KiB | 5 Q