3v4l.org

run code in 300+ PHP versions simultaneously
<?php function toCents($amount) { $cents = explode(',', $amount); if (!isset($cents[1])) $cents[1] = '00'; return (int) implode($cents); } $amount = '350.000,95'; echo toCents($amount); echo ' - '; $amount = '150'; echo toCents($amount);

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.0100.01016.63
8.3.50.0120.00618.16
8.3.40.0070.00718.64
8.3.30.0080.00618.87
8.3.20.0080.00020.26
8.3.10.0080.00021.90
8.3.00.0040.00719.26
8.2.180.0110.01118.18
8.2.170.0040.01122.96
8.2.160.0130.00320.39
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0000.00819.54
8.2.110.0060.00320.52
8.2.100.0090.00418.03
8.2.90.0040.00418.05
8.2.80.0050.00317.97
8.2.70.0040.00418.05
8.2.60.0030.00618.04
8.2.50.0040.00418.10
8.2.40.0080.00020.47
8.2.30.0040.00418.18
8.2.20.0040.00417.62
8.2.10.0040.00418.18
8.2.00.0070.00017.65
8.1.280.0030.01425.92
8.1.270.0100.00020.67
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00022.59
8.1.230.0080.00419.04
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0100.00317.10
8.1.190.0030.00617.36
8.1.180.0000.00818.10
8.1.170.0060.00318.64
8.1.160.0000.00722.02
8.1.150.0070.00018.89
8.1.140.0000.00717.51
8.1.130.0000.00717.82
8.1.120.0070.00017.50
8.1.110.0080.00017.46
8.1.100.0050.00317.45
8.1.90.0030.00317.45
8.1.80.0050.00217.38
8.1.70.0000.00717.36
8.1.60.0030.00617.59
8.1.50.0030.00517.52
8.1.40.0070.00017.36
8.1.30.0050.00317.64
8.1.20.0040.00417.62
8.1.10.0050.00517.55
8.1.00.0060.00317.40
8.0.300.0000.00819.72
8.0.290.0090.00016.75
8.0.280.0000.00718.45
8.0.270.0030.00317.25
8.0.260.0000.00717.17
8.0.250.0000.00716.94
8.0.240.0030.00317.00
8.0.230.0030.00417.02
8.0.220.0000.00716.80
8.0.210.0070.00016.86
8.0.200.0000.00716.87
8.0.190.0060.00316.96
8.0.180.0000.00716.82
8.0.170.0000.00816.91
8.0.160.0030.00316.97
8.0.150.0030.00316.75
8.0.140.0000.00816.84
8.0.130.0030.00313.28
8.0.120.0030.00516.86
8.0.110.0040.00416.81
8.0.100.0030.00616.77
8.0.90.0000.00716.75
8.0.80.0100.01016.92
8.0.70.0050.00316.97
8.0.60.0040.00416.79
8.0.50.0030.00516.84
8.0.30.0120.01117.06
8.0.20.0080.01017.40
8.0.10.0030.00517.01
8.0.00.0130.00516.69
7.4.330.0060.00015.09
7.4.320.0000.00716.51
7.4.300.0000.00716.59
7.4.290.0060.00016.62
7.4.280.0080.00016.52
7.4.270.0030.00316.53
7.4.260.0000.00716.63
7.4.250.0050.00316.46
7.4.240.0030.00416.60
7.4.230.0000.00716.63
7.4.220.0150.00316.55
7.4.210.0040.01216.63
7.4.200.0050.00216.32
7.4.160.0110.00416.51
7.4.150.0130.00417.40
7.4.140.0120.00517.86
7.4.130.0090.00916.64
7.4.120.0080.01516.59
7.4.110.0120.01216.43
7.4.100.0120.00616.55
7.4.90.0060.01216.52
7.4.80.0140.00919.39
7.4.70.0100.00716.50
7.4.60.0030.01316.64
7.4.50.0040.00416.57
7.4.40.0060.01116.59
7.4.30.0170.00616.61
7.4.00.0030.01315.07
7.3.330.0030.00313.37
7.3.320.0060.00913.33
7.3.310.0000.00716.32
7.3.300.0000.00716.42
7.3.290.0070.00916.39
7.3.280.0070.01116.39
7.3.270.0090.00917.40
7.3.260.0140.00416.37
7.3.250.0070.01116.50
7.3.240.0060.01116.51
7.3.230.0140.00416.39
7.3.210.0100.01016.27
7.3.200.0100.01319.39
7.3.190.0100.00716.49
7.3.180.0080.00816.48
7.3.170.0150.00316.56
7.3.160.0080.00816.33
7.3.10.0110.00415.89
7.3.00.0070.01015.99
7.2.330.0150.00716.66
7.2.320.0100.00716.61
7.2.310.0140.00316.71
7.2.300.0130.01016.65
7.2.290.0140.00816.77
7.2.130.0140.00716.44
7.2.120.0140.01416.85
7.2.110.0190.00817.00
7.2.100.0180.00916.86
7.2.90.0150.00616.62
7.2.80.0160.00716.79
7.2.70.0180.01116.74
7.2.60.0120.01416.68
7.2.50.0170.01016.36
7.2.40.0140.00616.80
7.2.30.0150.00316.55
7.2.20.0080.01217.02
7.2.10.0100.01116.70
7.2.00.0040.01118.15
7.1.250.0210.00015.79
7.1.100.0070.00718.13
7.1.70.0000.01117.23
7.1.60.0190.00319.46
7.1.50.0030.01217.04
7.1.00.0030.07722.36
7.0.200.0100.00016.90
7.0.140.0070.06721.90
7.0.60.0030.08019.91
7.0.50.0070.05717.80
7.0.40.0030.09720.26
7.0.30.0530.06320.22
7.0.20.0330.05720.06
7.0.10.0170.04720.30
7.0.00.0100.08020.20
5.6.280.0030.07321.08
5.6.210.0170.06320.71
5.6.200.0100.04318.15
5.6.190.0000.04720.49
5.6.180.0170.04020.47
5.6.170.0330.07320.54
5.6.160.0000.04320.39
5.6.150.0130.07318.27
5.6.140.0100.07718.27
5.6.130.0070.07718.22
5.6.120.0030.04321.01
5.6.110.0100.08721.00
5.6.100.0070.07021.09
5.6.90.0100.09021.02
5.6.80.0100.05320.39
5.6.70.2930.03320.43
5.5.350.0070.06720.41
5.5.340.0070.04317.99
5.5.330.0030.04320.35
5.5.320.0330.04020.32
5.5.310.0270.07720.34
5.5.300.0030.07318.07
5.5.290.0070.08017.95
5.5.280.0070.03720.87
5.5.270.0070.04720.79
5.5.260.0170.04320.64
5.5.250.0170.07020.48
5.5.240.0030.05320.29
5.4.450.0200.07319.48
5.4.440.0130.06719.61
5.4.430.0270.06019.30
5.4.420.0470.05019.58
5.4.410.0070.06319.32
5.4.400.0230.04718.49
5.4.390.0270.04718.57
5.4.380.0230.05018.57
5.4.370.0300.04018.70
5.4.360.0200.04718.79
5.4.350.0230.05318.77
5.4.340.0230.05318.45
5.4.320.0130.05718.54
5.4.310.0230.04718.44
5.4.300.0130.05718.76
5.4.290.0170.05018.75
5.4.280.0270.05318.48
5.4.270.0170.05018.54
5.4.260.0170.05318.78
5.4.250.0130.05718.50
5.4.240.0070.06318.75
5.4.230.0230.04718.43
5.4.220.0230.05718.74
5.4.210.0200.06018.77
5.4.200.0130.05716.68
5.4.190.0200.05018.70
5.4.180.0200.04718.55
5.4.170.0100.06318.71
5.4.160.0200.04718.76
5.4.150.0170.05318.56
5.4.140.0070.06016.29
5.4.130.0130.04716.21
5.4.120.0270.03716.19
5.4.110.0130.07016.24
5.4.100.0130.07316.30
5.4.90.0170.05016.24
5.4.80.0200.04316.17
5.4.70.0100.06316.38
5.4.60.0130.05016.18
5.4.50.0070.05716.13
5.4.40.0100.05716.29
5.4.30.0130.05316.28
5.4.20.0200.05316.41
5.4.10.0200.04316.39
5.4.00.0130.05715.75
5.3.290.0130.05714.86
5.3.280.0100.05714.77
5.3.270.0130.06314.82
5.3.260.0200.05014.70
5.3.250.0170.06714.81
5.3.240.0230.06714.62
5.3.230.0230.06314.62
5.3.220.0200.07014.75
5.3.210.0170.05714.67
5.3.200.0270.04314.79
5.3.190.0100.06314.62
5.3.180.0200.04314.56
5.3.170.0200.05014.68
5.3.160.0200.04714.67
5.3.150.0230.04314.74
5.3.140.0170.07314.57
5.3.130.0170.05714.57
5.3.120.0130.05714.54
5.3.110.0170.05014.73
5.3.100.0130.06714.03
5.3.90.0170.07014.06
5.3.80.0270.03713.96
5.3.70.0170.04714.05
5.3.60.0270.04014.05
5.3.50.0170.04714.02
5.3.40.0230.04314.19
5.3.30.0230.06014.11
5.3.20.0130.05013.67
5.3.10.0170.04313.65
5.3.00.0030.06013.80
5.2.170.0170.03711.27
5.2.160.0130.04011.24
5.2.150.0130.04011.16
5.2.140.0130.04011.24
5.2.130.0130.04011.13
5.2.120.0170.03711.14
5.2.110.0100.05011.23
5.2.100.0130.03711.14
5.2.90.0130.03711.12
5.2.80.0170.04011.22
5.2.70.0170.03711.33
5.2.60.0100.04311.15
5.2.50.0100.04711.07
5.2.40.0100.04011.09
5.2.30.0100.04311.09
5.2.20.0070.04310.95
5.2.10.0100.04011.08
5.2.00.0000.05010.75
5.1.60.0130.03010.02
5.1.50.0130.03010.18
5.1.40.0170.02710.03
5.1.30.0170.03010.33
5.1.20.0030.04310.48
5.1.10.0030.04310.10
5.1.00.0100.03310.11
5.0.50.0100.0278.54
5.0.40.0030.0308.45
5.0.30.0030.0478.26
5.0.20.0130.0308.34
5.0.10.0100.0308.19
5.0.00.0070.0438.29
4.4.90.0070.0205.88
4.4.80.0030.0235.86
4.4.70.0030.0235.90
4.4.60.0100.0205.97
4.4.50.0070.0205.90
4.4.40.0070.0335.88
4.4.30.0030.0305.93
4.4.20.0070.0275.95
4.4.10.0030.0235.98
4.4.00.0070.0336.01
4.3.110.0000.0275.90
4.3.100.0100.0175.86
4.3.90.0000.0235.84
4.3.80.0030.0335.89
4.3.70.0070.0205.86
4.3.60.0030.0205.79
4.3.50.0030.0235.80
4.3.40.0030.0335.75
4.3.30.0070.0204.69
4.3.20.0070.0174.56
4.3.10.0070.0204.56
4.3.00.0130.0206.91

preferences:
49.36 ms | 400 KiB | 5 Q