3v4l.org

run code in 300+ PHP versions simultaneously
<?php $price = '10.156'; $price = str_replace(',', '', $price); $price = str_replace('.', ',', $price); // print ($price); print (strpos($price, ",")); if (strpos($price, ',') !== false) { $nbchardecim = strlen(substr($price, strpos($price, ",") + 1)) ; if ($nbchardecim > 2) { $price = substr($price, 0,strlen($price)- $nbchardecim+2); } } print ($price);

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.0120.00618.43
8.3.50.0030.01016.39
8.3.40.0070.00718.64
8.3.30.0190.00018.54
8.3.20.0080.00021.90
8.3.10.0070.00021.91
8.3.00.0050.00219.79
8.2.180.0090.00616.75
8.2.170.0040.01122.96
8.2.160.0170.00321.06
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00421.96
8.2.120.0080.00026.35
8.2.110.0100.00020.39
8.2.100.0070.00417.91
8.2.90.0000.00819.13
8.2.80.0060.00617.97
8.2.70.0000.00817.63
8.2.60.0000.00817.93
8.2.50.0080.00018.10
8.2.40.0000.00720.45
8.2.30.0080.00019.31
8.2.20.0030.00518.11
8.2.10.0040.00418.19
8.2.00.0070.00018.11
8.1.280.0060.00925.92
8.1.270.0040.00423.98
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0060.00323.79
8.1.230.0070.00319.16
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0000.00817.22
8.1.190.0000.00817.23
8.1.180.0070.00018.10
8.1.170.0040.00418.52
8.1.160.0000.00718.70
8.1.150.0040.00420.27
8.1.140.0040.00419.51
8.1.130.0030.00318.74
8.1.120.0000.00717.40
8.1.110.0050.00217.38
8.1.100.0030.00317.31
8.1.90.0040.00417.38
8.1.80.0070.00017.27
8.1.70.0040.00417.28
8.1.60.0040.00417.38
8.1.50.0000.00717.51
8.1.40.0040.00417.47
8.1.30.0040.00417.47
8.1.20.0030.00517.55
8.1.10.0000.00717.51
8.1.00.0040.00417.45
8.0.300.0030.00518.77
8.0.290.0030.00616.75
8.0.280.0080.00018.40
8.0.270.0000.00717.16
8.0.260.0030.00316.81
8.0.250.0000.00716.84
8.0.240.0000.00716.88
8.0.230.0040.00416.75
8.0.220.0000.00716.83
8.0.210.0000.00816.81
8.0.200.0050.00316.86
8.0.190.0000.00816.89
8.0.180.0000.00716.91
8.0.170.0000.00816.89
8.0.160.0030.00416.76
8.0.150.0050.00316.82
8.0.140.0040.00416.77
8.0.130.0040.00413.20
8.0.120.0000.00716.78
8.0.110.0000.00716.70
8.0.100.0050.00216.70
8.0.90.0000.00716.71
8.0.80.0100.00616.77
8.0.70.0070.00016.83
8.0.60.0070.00016.88
8.0.50.0040.00416.86
8.0.30.0090.00617.03
8.0.20.0130.00617.40
8.0.10.0040.00417.05
8.0.00.0090.00916.71
7.4.330.0020.00215.55
7.4.320.0070.00016.62
7.4.300.0030.00316.57
7.4.290.0100.00016.59
7.4.280.0000.00816.44
7.4.270.0040.00416.64
7.4.260.0080.00016.50
7.4.250.0050.00216.45
7.4.240.0000.00816.57
7.4.230.0000.00716.34
7.4.220.0030.01416.44
7.4.210.0060.01016.68
7.4.200.0030.00316.67
7.4.160.0070.00916.56
7.4.150.0170.00017.40
7.4.140.0110.01217.86
7.4.130.0090.01516.51
7.4.120.0100.00816.36
7.4.110.0130.00316.61
7.4.100.0090.01516.54
7.4.90.0070.01116.48
7.4.80.0170.00019.39
7.4.70.0070.01116.33
7.4.60.0060.00916.52
7.4.50.0090.00916.60
7.4.40.0030.01716.46
7.4.30.0140.00316.60
7.4.00.0070.01014.86
7.3.330.0000.00613.21
7.3.320.0050.00013.13
7.3.310.0040.00416.38
7.3.300.0030.00316.37
7.3.290.0060.01016.35
7.3.280.0060.01116.31
7.3.270.0320.01217.40
7.3.260.0130.00416.51
7.3.250.0090.01116.37
7.3.240.0080.00816.38
7.3.230.0100.00716.44
7.3.210.0100.01016.54
7.3.200.0100.01016.40
7.3.190.0030.01516.38
7.3.180.0050.01116.35
7.3.170.0100.00716.28
7.3.160.0070.01116.25
7.2.330.0040.01416.65
7.2.320.0030.01316.58
7.2.310.0030.01316.55
7.2.300.0110.00716.65
7.2.290.0090.01116.59
7.2.60.0030.00916.65
7.2.00.0240.00418.98
7.1.200.0030.01015.54
7.1.100.0090.00618.28
7.1.70.0000.00917.32
7.1.60.0370.01033.00
7.1.50.0470.01732.74
7.1.40.0470.01332.51
7.1.30.0570.01332.77
7.1.20.0530.01032.64
7.1.10.0570.00714.69
7.1.00.0370.01014.98
7.0.200.0300.01014.96
7.0.190.0430.01014.73
7.0.180.0270.00714.67
7.0.170.0430.00314.52
7.0.160.0670.01014.59
7.0.150.0470.00714.51
7.0.140.0500.01314.45
7.0.130.0300.01314.59
7.0.120.0370.00714.82
7.0.110.0270.00714.40
7.0.100.0400.01314.40
7.0.90.0270.01314.41
7.0.80.0930.00314.47
7.0.70.0470.00714.55
7.0.60.0300.01714.08
7.0.50.0300.00714.59
7.0.40.0430.01014.82
7.0.30.0600.00714.61
7.0.20.0230.01314.78
7.0.10.0370.01314.51
7.0.00.0370.01014.65

preferences:
56.42 ms | 401 KiB | 5 Q