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('/(\d+(?:\.\d+)?)(\s*[€%])/i', function($matches) use ($levelamt){ return number_format(round(($matches[1] * $levelamt), 2), 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.10.0140.00616.80
8.5.00.0160.00520.44
8.4.150.0020.00014.05
8.4.140.0110.01017.92
8.4.130.0120.00818.01
8.4.120.0070.00220.76
8.4.110.0120.00922.44
8.4.100.0060.00320.38
8.4.90.0130.00918.83
8.4.80.0030.00618.90
8.4.70.0050.00318.36
8.4.60.0110.00918.65
8.4.50.0100.01220.36
8.4.40.0030.00619.97
8.4.30.0090.00919.47
8.4.20.0070.01120.78
8.4.10.0030.00617.73
8.3.280.0140.00718.57
8.3.270.0110.00816.54
8.3.260.0040.00416.77
8.3.250.0150.00518.83
8.3.240.0110.00717.41
8.3.230.0140.00616.77
8.3.220.0060.00218.91
8.3.210.0110.00716.81
8.3.200.0050.00416.53
8.3.190.0090.00717.28
8.3.180.0120.00716.54
8.3.170.0150.00320.70
8.3.160.0120.00617.13
8.3.150.0200.00017.20
8.3.140.0110.00416.96
8.3.130.0050.00518.43
8.3.120.0030.00618.96
8.3.110.0060.00320.94
8.3.100.0040.00416.57
8.3.90.0080.00026.77
8.3.80.0060.00318.43
8.3.70.0090.00618.43
8.3.60.0150.00018.56
8.3.50.0120.00319.23
8.3.40.0070.00718.79
8.3.30.0070.00718.95
8.3.20.0040.00421.93
8.3.10.0080.00023.73
8.3.00.0080.00023.63
8.2.290.0090.01020.54
8.2.280.0110.00718.54
8.2.270.0120.00619.09
8.2.260.0040.00418.59
8.2.250.0090.00018.71
8.2.240.0090.00918.54
8.2.230.0080.00022.58
8.2.220.0050.00324.06
8.2.210.0030.00626.77
8.2.200.0080.00416.88
8.2.190.0070.00718.43
8.2.180.0090.00916.50
8.2.170.0110.01122.96
8.2.160.0090.00920.30
8.2.150.0050.00324.18
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0100.00020.77
8.2.110.0040.00722.38
8.2.100.0030.00918.03
8.2.90.0080.00018.09
8.2.80.0000.00719.53
8.2.70.0040.00417.88
8.2.60.0000.00818.00
8.2.50.0030.00618.10
8.2.40.0050.00219.60
8.2.30.0000.00819.40
8.2.20.0040.00418.09
8.2.10.0040.00420.64
8.2.00.0040.00419.57
8.1.330.0070.01321.90
8.1.320.0130.00816.14
8.1.310.0070.00316.43
8.1.300.0080.00816.16
8.1.290.0060.00318.88
8.1.280.0170.00025.92
8.1.270.0080.00019.02
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00320.82
8.1.230.0080.00421.02
8.1.220.0000.00817.79
8.1.210.0030.00618.90
8.1.200.0040.00417.38
8.1.190.0050.00317.48
8.1.180.0080.00018.10
8.1.170.0050.00318.83
8.1.160.0040.00418.98
8.1.150.0030.00518.87
8.1.140.0000.00722.24
8.1.130.0060.00320.11
8.1.120.0000.00717.65
8.1.110.0040.00417.70
8.1.100.0040.00417.57
8.1.90.0040.00317.73
8.1.80.0060.00317.54
8.1.70.0030.00717.65
8.1.60.0030.00517.69
8.1.50.0000.00817.67
8.1.40.0040.00417.79
8.1.30.0050.00317.81
8.1.20.0000.00717.82
8.1.10.0080.00017.82
8.1.00.0060.00317.59
8.0.300.0070.00022.13
8.0.290.0000.00816.88
8.0.280.0070.00018.54
8.0.270.0000.00717.35
8.0.260.0030.00318.54
8.0.250.0070.00317.21
8.0.240.0030.00317.22
8.0.230.0070.00017.14
8.0.220.0070.00016.99
8.0.210.0040.00417.11
8.0.200.0060.00017.17
8.0.190.0040.00417.16
8.0.180.0080.00017.02
8.0.170.0000.00817.11
8.0.160.0000.00717.16
8.0.150.0000.01016.93
8.0.140.0030.00317.07
8.0.130.0030.00313.48
8.0.120.0000.00817.02
8.0.110.0040.00417.02
8.0.100.0040.00417.16
8.0.90.0000.00716.94
8.0.80.0090.00517.08
8.0.70.0040.00417.14
8.0.60.0000.00817.00
8.0.50.0040.00417.16
8.0.30.0130.00417.29
8.0.20.0140.00817.40
8.0.10.0050.00217.09
8.0.00.0090.00917.01
7.4.330.0000.00516.78
7.4.320.0030.00316.80
7.4.300.0030.00316.78
7.4.290.0070.00016.89
7.4.280.0030.00516.79
7.4.270.0030.00316.74
7.4.260.0070.00016.79
7.4.250.0070.00016.87
7.4.240.0000.00716.77
7.4.230.0030.00316.70
7.4.220.0000.00716.69
7.4.210.0090.00516.91
7.4.200.0070.00016.69
7.4.160.0120.00516.81
7.4.140.0100.00817.86
7.4.130.0130.00316.65
7.4.120.0070.01116.81
7.4.110.0110.00716.77
7.4.100.0110.00816.80
7.4.90.0070.01116.55
7.4.80.0110.00819.39
7.4.70.0070.01016.88
7.4.60.0100.00716.80
7.4.50.0030.01316.76
7.4.40.0120.00316.62
7.4.00.0000.01615.30
7.3.330.0030.00313.50
7.3.320.0000.00513.59
7.3.310.0090.00016.54
7.3.300.0000.00716.59
7.3.290.0030.00316.52
7.3.280.0080.00716.53
7.3.260.0110.00716.73
7.3.240.0100.00916.76
7.3.230.0110.00716.71
7.3.210.0100.00716.74
7.3.200.0090.00916.78
7.3.190.0060.01216.79
7.3.180.0070.00716.45
7.3.170.0130.01216.51
7.3.160.0120.00416.77
7.3.120.0110.00415.38
7.3.110.0040.00815.02
7.3.100.0070.01015.25
7.3.90.0120.00315.35
7.3.80.0090.00314.59
7.3.70.0030.01314.86
7.3.60.0000.01215.00
7.3.50.0000.01414.86
7.3.40.0030.01315.03
7.3.30.0100.00714.84
7.3.20.0120.00616.81
7.3.10.0070.00616.94
7.3.00.0570.00815.65
7.2.330.0150.00316.98
7.2.320.0110.01116.98
7.2.310.0090.01216.86
7.2.300.0130.00916.90
7.2.290.0080.01516.75
7.2.240.0080.00815.52
7.2.230.0040.00715.24
7.2.220.0110.00415.10
7.2.210.0060.00915.14
7.2.200.0040.01115.24
7.2.190.0040.01115.29
7.2.180.0080.00815.40
7.2.170.0130.00315.39
7.2.160.0080.00415.29
7.2.150.0090.00917.11
7.2.140.0000.01617.30
7.2.130.0430.01116.25
7.2.120.0070.00716.43
7.2.110.0340.00816.48
7.2.100.0450.01016.39
7.2.90.0360.00916.50
7.2.80.0270.01216.38
7.2.70.0340.00816.41
7.2.60.0230.00816.42
7.2.50.0420.00916.51
7.2.40.0350.01016.56
7.2.30.0240.00716.60
7.2.20.0190.01116.56
7.2.10.0310.00716.41
7.2.00.0220.01016.45
7.1.330.0070.01015.96
7.1.320.0070.00716.21
7.1.310.0070.00715.96
7.1.300.0060.01115.71
7.1.290.0060.00915.96
7.1.280.0030.00716.16
7.1.270.0030.01015.82
7.1.260.0000.01716.13
7.1.250.0400.01015.38
7.0.330.1020.01014.64
5.6.380.0080.00514.54

preferences:
47.8 ms | 403 KiB | 5 Q