3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "description: test1: 10 €, test2: 7.50 €, test3: 25%, test4: 30%"; $levelamt = 0.75; $description = preg_replace_callback('/([0-9][.0-9]*)\s*(\s€|%)/i', function($matches) use ($levelamt){ return round(($matches[1] * $levelamt),2).$matches[2]; }, $string); echo $description;

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.5.30.0110.00721.07
8.5.20.0150.00319.42
8.5.10.0090.00917.00
8.5.00.0140.00820.27
8.4.180.0090.01125.63
8.4.170.0100.01123.79
8.4.160.0120.01223.86
8.4.150.0070.00517.92
8.4.140.0100.01517.84
8.4.130.0160.00517.99
8.4.120.0120.00720.75
8.4.110.0090.01122.54
8.4.100.0100.01018.13
8.4.90.0140.00717.97
8.4.80.0130.00718.20
8.4.70.0130.00817.98
8.4.60.0030.00718.53
8.4.50.0090.00919.83
8.4.40.0100.01019.90
8.4.30.0070.01417.98
8.4.20.0130.00720.46
8.4.10.0030.00617.80
8.3.300.0120.00922.86
8.3.290.0130.00820.87
8.3.280.0170.00918.59
8.3.270.0100.01016.79
8.3.260.0130.00616.48
8.3.250.0080.01119.05
8.3.240.0110.00816.66
8.3.230.0050.00316.66
8.3.220.0020.00617.19
8.3.210.0130.00616.78
8.3.200.0020.00716.57
8.3.190.0120.00617.19
8.3.180.0110.00817.09
8.3.170.0090.00916.84
8.3.160.0070.01116.75
8.3.150.0090.00619.04
8.3.140.0050.00316.72
8.3.130.0070.00718.48
8.3.120.0100.00720.90
8.3.110.0070.00420.94
8.3.100.0050.00324.06
8.3.90.0040.01426.77
8.3.80.0050.00517.97
8.3.70.0080.00816.75
8.3.60.0080.00818.56
8.3.50.0100.00419.19
8.3.40.0130.00619.09
8.3.30.0110.00419.04
8.3.20.0000.00721.71
8.3.10.0030.00623.64
8.3.00.0080.00023.79
8.2.300.0170.01118.29
8.2.290.0100.00720.51
8.2.280.0110.00818.43
8.2.270.0150.00417.30
8.2.260.0180.00019.00
8.2.250.0030.00617.00
8.2.240.0000.01019.04
8.2.230.0100.01022.58
8.2.220.0030.00537.54
8.2.210.0110.00426.77
8.2.200.0040.00418.54
8.2.190.0110.00418.39
8.2.180.0160.00318.54
8.2.170.0150.00022.96
8.2.160.0140.00420.29
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00018.22
8.2.120.0040.00426.35
8.2.110.0060.00322.38
8.2.100.0060.00617.97
8.2.90.0080.00018.00
8.2.80.0030.00619.07
8.2.70.0040.00417.88
8.2.60.0030.00617.88
8.2.50.0040.00418.10
8.2.40.0040.00419.49
8.2.30.0020.00519.39
8.2.20.0000.00818.17
8.2.10.0070.00020.54
8.2.00.0080.00019.57
8.1.340.0130.00621.77
8.1.330.0110.00718.26
8.1.320.0090.00416.46
8.1.310.0080.00016.97
8.1.300.0110.00018.02
8.1.290.0030.00630.84
8.1.280.0210.00025.92
8.1.270.0030.00619.13
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00719.06
8.1.230.0040.00817.77
8.1.220.0060.00317.77
8.1.210.0040.00418.77
8.1.200.0000.00817.48
8.1.190.0030.00917.25
8.1.180.0040.00418.10
8.1.170.0040.00418.71
8.1.160.0070.00018.84
8.1.150.0000.00818.91
8.1.140.0000.00723.89
8.1.130.0070.00020.11
8.1.120.0040.00417.70
8.1.110.0040.00417.57
8.1.100.0070.00017.68
8.1.90.0000.00717.60
8.1.80.0030.00517.71
8.1.70.0050.00517.65
8.1.60.0050.00517.79
8.1.50.0040.00417.75
8.1.40.0030.00617.72
8.1.30.0040.00417.93
8.1.20.0070.00017.91
8.1.10.0080.00017.76
8.1.00.0040.00417.75
8.0.300.0080.00018.96
8.0.290.0040.00416.75
8.0.280.0040.00418.46
8.0.270.0070.00017.41
8.0.260.0000.00618.45
8.0.250.0000.00717.12
8.0.240.0000.00717.16
8.0.230.0070.00017.07
8.0.220.0070.00017.13
8.0.210.0040.00416.98
8.0.200.0040.00417.08
8.0.190.0000.00817.16
8.0.180.0000.00817.14
8.0.170.0030.00517.18
8.0.160.0040.00417.03
8.0.150.0040.00417.05
8.0.140.0050.00217.05
8.0.130.0000.00613.45
8.0.120.0040.00416.99
8.0.110.0000.00717.11
8.0.100.0000.00716.89
8.0.90.0040.00417.03
8.0.80.0130.01017.10
8.0.70.0040.00417.15
8.0.60.0040.00417.11
8.0.50.0000.00716.98
8.0.30.0150.00317.29
8.0.20.0060.01317.61
8.0.10.0000.00817.32
8.0.00.0120.00917.15
7.4.330.0000.00516.86
7.4.320.0060.00016.89
7.4.300.0030.00316.79
7.4.290.0030.00316.78
7.4.280.0040.00416.59
7.4.270.0050.00316.93
7.4.260.0030.00316.84
7.4.250.0070.00016.84
7.4.240.0000.01016.86
7.4.230.0040.00416.64
7.4.220.0050.00316.84
7.4.210.0100.00516.91
7.4.200.0030.00316.84
7.4.160.0100.00916.74
7.4.140.0120.00817.86
7.4.130.0080.00816.88
7.4.120.0130.00516.93
7.4.110.0090.00916.84
7.4.100.0110.00816.91
7.4.90.0030.01516.76
7.4.80.0110.01119.39
7.4.70.0160.00516.93
7.4.60.0040.01116.66
7.4.50.0070.00416.80
7.4.40.0070.01016.68
7.4.00.0060.01215.04
7.3.330.0000.00613.58
7.3.320.0060.00013.58
7.3.310.0030.00316.56
7.3.300.0000.00716.38
7.3.290.0000.00716.52
7.3.280.0090.00916.62
7.3.260.0120.00616.74
7.3.240.0120.00716.78
7.3.230.0110.00716.85
7.3.210.0140.00416.59
7.3.200.0210.00316.93
7.3.190.0080.01016.45
7.3.180.0090.00916.66
7.3.170.0170.00616.77
7.3.160.0060.01216.82
7.3.120.0040.01215.10
7.3.110.0080.01114.98
7.3.100.0070.01014.97
7.3.90.0060.00714.93
7.3.80.0080.00614.95
7.3.70.0060.00614.95
7.3.60.0080.00615.08
7.3.50.0060.00814.93
7.3.40.0070.00414.88
7.3.30.0040.00715.05
7.3.20.0090.00716.86
7.3.10.0070.00616.72
7.3.00.0130.00716.72
7.2.330.0130.00317.04
7.2.320.0100.00717.13
7.2.310.0030.01516.97
7.2.300.0030.01316.98
7.2.290.0070.01516.87
7.2.250.0070.00815.17
7.2.240.0040.01315.41
7.2.230.0050.01215.29
7.2.220.0080.00815.27
7.2.210.0080.00815.24
7.2.200.0040.01015.02
7.2.190.0040.01015.29
7.2.180.0060.00715.30
7.2.170.0080.00415.16
7.2.160.0060.00615.05
7.2.150.0110.00316.92
7.2.140.0110.00317.01
7.2.130.0060.01216.85
7.2.120.0100.00816.93
7.2.110.0060.01016.92
7.2.100.0120.00616.93
7.2.90.0100.00617.05
7.2.80.0060.00917.03
7.2.70.0070.01217.07
7.2.60.0070.00817.04
7.2.50.0100.00716.94
7.2.40.0050.01217.05
7.2.30.0110.00616.92
7.2.20.0120.01016.90
7.2.10.0080.00816.97
7.2.00.0080.00717.17
7.1.330.0070.00715.93
7.1.320.0060.00915.95
7.1.310.0050.01016.11
7.1.300.0020.01215.89
7.1.290.0030.00915.87
7.1.280.0050.00716.03
7.1.270.0030.00716.03
7.1.260.0020.01115.96
7.1.250.0040.00915.66
7.1.240.0030.00716.18
7.1.230.0090.00616.06
7.1.220.0060.00915.82
7.1.210.0060.00315.62
7.1.200.0090.00615.87
7.1.190.0030.00716.12
7.1.180.0060.00316.05
7.1.170.0080.00415.64
7.1.160.0070.00316.19
7.1.150.0070.00715.93
7.1.140.0030.00716.08
7.1.130.0120.00315.86
7.1.120.0090.00616.20
7.1.110.0030.01316.16
7.1.100.0030.00916.00
7.1.90.0070.00716.04
7.1.80.0060.00615.96
7.1.70.0040.01116.10
7.1.60.0040.00716.08
7.1.50.0090.00616.09
7.1.40.0040.00716.06
7.1.30.0060.01116.09
7.1.20.0060.00816.03
7.1.10.0110.00015.70
7.1.00.0080.00615.91
7.0.330.0040.00915.54
7.0.320.0090.00615.74
7.0.310.0030.01315.40
7.0.300.0070.00715.67
7.0.290.0040.00415.52
7.0.280.0000.01515.32
7.0.270.0100.00315.56
7.0.260.0090.00615.53
7.0.250.0090.00615.71
7.0.240.0070.00415.70
7.0.230.0040.00815.79
7.0.220.0060.00615.80
7.0.210.0040.01115.51
7.0.200.0030.01215.74
7.0.190.0030.01315.63
7.0.180.0030.00615.76
7.0.170.0030.01015.41
7.0.160.0030.01015.61
7.0.150.0030.00715.44
7.0.140.0000.00915.63
7.0.130.0060.00615.58
7.0.120.0060.00615.91
7.0.110.0030.01415.65
7.0.100.0090.00015.44
7.0.90.0030.01015.69
7.0.80.0030.01015.50
7.0.70.0090.00615.71
7.0.60.0060.00915.26
7.0.50.0040.00415.91
7.0.40.0060.00913.56
7.0.30.0090.00913.78
7.0.20.0090.00313.55
7.0.10.0070.01113.67
7.0.00.0040.01213.52
5.6.400.0070.00714.48
5.6.390.0030.00614.39
5.6.380.0050.00814.66
5.6.370.0130.00014.53
5.6.360.0160.00014.51
5.6.350.0000.01514.73
5.6.340.0070.00314.85
5.6.330.0030.00614.85
5.6.320.0090.00614.11
5.6.310.0030.00714.43
5.6.300.0070.00414.47
5.6.290.0060.00314.65
5.6.280.0030.00914.66
5.6.270.0100.00714.55
5.6.260.0080.00014.56
5.6.250.0040.01214.42
5.6.240.0030.01414.56
5.6.230.0070.01014.34
5.6.220.0070.00314.37
5.6.210.0030.01014.46
5.6.200.0030.01014.39
5.6.190.0100.00714.50
5.6.180.0060.01214.65
5.6.170.0040.00814.76
5.6.160.0000.00914.39
5.6.150.0030.00914.51
5.6.140.0030.00614.42
5.6.130.0060.00914.32
5.6.120.0060.00614.49
5.6.110.0070.00714.64
5.6.100.0060.00814.55
5.6.90.0090.00614.43
5.6.80.0060.00614.07
5.6.70.0060.00614.22
5.6.60.0030.01014.33
5.6.50.0030.01014.41
5.6.40.0040.00714.51
5.6.30.0070.00714.51
5.6.20.0090.00314.46
5.6.10.0100.00314.30
5.6.00.0000.01114.45

preferences:
56.91 ms | 1932 KiB | 5 Q