3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rate1 = 0.02; $var = sprintf("%.2f",1260); //$var holds numeric string var_dump($var,"\n\n"); $var = 1260; $product = $var * $rate1; var_dump("product:", $product,"\n"); // two ways to format $product echo number_format( $product, 2),"\n"; echo printf("%.2f",$product);

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.40.0040.01118.73
8.3.30.0040.01118.75
8.3.20.0130.00720.49
8.3.10.0040.00421.85
8.3.00.0080.00017.78
8.2.170.0080.00822.96
8.2.160.0070.00720.16
8.2.150.0050.00224.18
8.2.140.0000.00824.66
8.2.130.0050.00220.77
8.2.120.0040.00426.35
8.2.110.0070.00419.30
8.2.100.0040.00718.16
8.2.90.0030.00519.40
8.2.80.0050.00318.04
8.2.70.0080.00017.50
8.2.60.0060.00318.05
8.2.50.0030.00618.10
8.2.40.0060.00320.54
8.2.30.0000.00719.21
8.2.20.0050.00218.11
8.2.10.0030.00618.24
8.2.00.0000.00718.13
8.1.270.0000.00824.04
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00723.96
8.1.230.0040.00817.52
8.1.220.0040.00417.77
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0030.00618.65
8.1.160.0040.00419.15
8.1.150.0040.00418.88
8.1.140.0040.00419.47
8.1.130.0030.00317.55
8.1.120.0050.00317.53
8.1.110.0000.00717.42
8.1.100.0080.00017.35
8.1.90.0000.00717.39
8.1.80.0070.00017.34
8.1.70.0030.00517.45
8.1.60.0000.00817.46
8.1.50.0080.00017.40
8.1.40.0040.00417.47
8.1.30.0050.00317.61
8.1.20.0040.00417.56
8.1.10.0040.00417.46
8.1.00.0000.00817.52
8.0.300.0070.00018.77
8.0.290.0060.00316.75
8.0.280.0030.00318.55
8.0.270.0020.00717.30
8.0.260.0040.00416.87
8.0.250.0040.00417.07
8.0.240.0030.00317.05
8.0.230.0040.00417.01
8.0.220.0030.00416.79
8.0.210.0000.00716.86
8.0.200.0030.00316.88
8.0.190.0000.00816.91
8.0.180.0060.00316.95
8.0.170.0050.00316.82
8.0.160.0040.00416.88
8.0.150.0000.00716.80
8.0.140.0040.00416.84
8.0.130.0000.00613.37
8.0.120.0040.00416.86
8.0.110.0000.00716.91
8.0.100.0000.00716.97
8.0.90.0080.00016.89
8.0.80.0090.00616.93
8.0.70.0080.00016.77
8.0.60.0040.00416.88
8.0.50.0050.00216.87
8.0.30.0070.01217.15
8.0.20.0140.00717.40
8.0.10.0040.00416.99
8.0.00.0070.01016.79
7.4.330.0020.00215.55
7.4.320.0040.00416.45
7.4.300.0000.00616.56
7.4.290.0070.00016.41
7.4.280.0080.00016.34
7.4.270.0070.00016.46
7.4.260.0060.00013.28
7.4.250.0040.00416.56
7.4.240.0040.00416.47
7.4.230.0070.00016.54
7.4.220.0180.00616.45
7.4.210.0070.00916.66
7.4.200.0050.00316.63
7.4.160.0090.00616.57
7.4.150.0030.01517.40
7.4.140.0110.00717.86
7.4.130.0130.00916.58
7.4.120.0080.01216.46
7.4.110.0040.01416.40
7.4.100.0080.00816.46
7.4.90.0130.00316.51
7.4.80.0120.00619.39
7.4.70.0130.00316.41
7.4.60.0070.01016.43
7.4.50.0030.00616.57
7.4.40.0100.00616.66
7.4.30.0060.01116.41
7.4.00.0050.01115.00
7.3.330.0000.00513.13
7.3.320.0000.00613.01
7.3.310.0070.00016.23
7.3.300.0000.00716.23
7.3.290.0040.00416.24
7.3.280.0080.00916.25
7.3.270.0130.00317.40
7.3.260.0140.02216.22
7.3.250.0100.00916.32
7.3.240.0070.01016.31
7.3.230.0080.01216.35
7.3.210.0070.01016.18
7.3.200.0120.00416.45
7.3.190.0130.00316.21
7.3.180.0030.01216.57
7.3.170.0100.01016.45
7.3.160.0160.00016.32
7.3.120.0060.00914.92
7.3.110.0030.01614.41
7.3.100.0110.00714.71
7.3.90.0040.00814.60
7.3.80.0120.00614.90
7.3.70.0090.00314.93
7.3.60.0060.00914.86
7.3.50.0070.01014.24
7.3.40.0100.00314.78
7.3.30.0110.00314.50
7.3.20.0070.00716.26
7.3.10.0050.00916.53
7.3.00.0080.00316.52
7.2.330.0150.00416.49
7.2.320.0130.00916.35
7.2.310.0030.01416.54
7.2.300.0140.00416.50
7.2.290.0050.01116.53
7.2.250.0060.00914.97
7.2.240.0030.01614.68
7.2.230.0060.00915.17
7.2.220.0070.00715.22
7.2.210.0030.01515.22
7.2.200.0100.00315.00
7.2.190.0030.00914.76
7.2.180.0120.00615.16
7.2.170.0120.00315.18
7.2.160.0030.01014.81
7.2.150.0070.00716.73
7.2.140.0080.00516.57
7.2.130.0020.01016.82
7.2.120.0060.00916.96
7.2.110.0030.00816.67
7.2.100.0050.00616.79
7.2.90.0090.00616.63
7.2.80.0080.00716.79
7.2.70.0040.01416.67
7.2.60.0050.00816.83
7.2.50.0030.01216.88
7.2.40.0060.00616.73
7.2.30.0050.00916.99
7.2.20.0050.01016.89
7.2.10.0050.00716.88
7.2.00.0070.00717.80
7.1.330.0070.00715.36
7.1.320.0000.01415.82
7.1.310.0060.00915.79
7.1.300.0000.00915.84
7.1.290.0030.01515.63
7.1.280.0120.00315.79
7.1.270.0110.00315.48
7.1.260.0090.00015.73
7.1.250.0060.00415.77
7.1.240.0060.00915.70
7.1.230.0000.01015.55
7.1.220.0070.00715.50
7.1.210.0030.01015.68
7.1.200.0060.00615.85
7.1.190.0000.01915.50
7.1.180.0040.00915.72
7.1.170.0030.00715.72
7.1.160.0030.01015.54
7.1.150.0070.01015.59
7.1.140.0040.01115.57
7.1.130.0060.00615.73
7.1.120.0030.00915.89
7.1.110.0030.00815.70
7.1.100.0090.00617.04
7.1.90.0070.01015.92
7.1.80.0070.00415.89
7.1.70.0050.00816.43
7.1.60.0130.00725.37
7.1.50.0080.01025.29
7.1.40.0140.00625.08
7.1.30.0110.01025.03
7.1.20.0100.01025.19
7.1.10.0070.00616.17
7.1.00.0090.00416.24
7.0.330.0120.00315.32
7.0.320.0000.01315.14
7.0.310.0030.00915.34
7.0.300.0000.01315.17
7.0.290.0030.00615.52
7.0.280.0100.00315.42
7.0.270.0040.01115.39
7.0.260.0090.00615.34
7.0.250.0080.00015.37
7.0.240.0060.00815.33
7.0.230.0030.01315.00
7.0.220.0000.01015.48
7.0.210.0120.00315.38
7.0.200.0040.00616.21
7.0.190.0080.00515.94
7.0.180.0050.00615.83
7.0.170.0050.00815.85
7.0.160.0050.00715.76
7.0.150.0080.00415.91
7.0.140.0060.00815.66
7.0.130.0060.00815.91
7.0.120.0060.00816.06
7.0.110.0060.00715.77
7.0.100.0050.00615.80
7.0.90.0040.00815.76
7.0.80.0070.00616.04
7.0.70.0050.00915.85
7.0.60.0050.00515.88
7.0.50.0050.00615.86
7.0.40.0060.00614.88
7.0.30.0050.00714.92
7.0.20.0050.01014.88
7.0.10.0070.00514.86
7.0.00.0080.00514.95
5.6.400.0040.00814.14
5.6.390.0030.00614.21
5.6.380.0030.00913.91
5.6.370.0070.00314.52
5.6.360.0040.00714.08
5.6.350.0060.00914.07
5.6.340.0070.01014.22
5.6.330.0030.01014.53
5.6.320.0100.00314.36
5.6.310.0030.00614.09
5.6.300.0070.00714.04
5.6.290.0110.00413.72
5.6.280.0030.01014.07
5.6.270.0030.01014.25
5.6.260.0100.00314.38
5.6.250.0040.00814.15
5.6.240.0090.00014.49
5.6.230.0030.01614.34
5.6.220.0090.00914.09
5.6.210.0040.00814.08
5.6.200.0040.01114.10
5.6.190.0070.00714.26
5.6.180.0000.01014.33
5.6.170.0070.00714.33
5.6.160.0090.00614.12
5.6.150.0070.00314.43
5.6.140.0000.01414.24
5.6.130.0030.00914.10
5.6.120.0060.00314.27
5.6.110.0000.01714.21
5.6.100.0000.01514.24
5.6.90.0070.01314.35
5.6.80.0000.01514.27
5.6.70.0070.00714.39
5.6.60.0040.01114.11
5.6.50.0070.01314.47
5.6.40.0100.01014.23
5.6.30.0060.00314.32
5.6.20.0000.01414.36
5.6.10.0110.00313.94
5.6.00.0000.01414.11

preferences:
48.82 ms | 400 KiB | 5 Q