3v4l.org

run code in 300+ PHP versions simultaneously
<?php function toCents($amount) { $cents = explode(',', $amount); if (!isset($cents[0])) $cents[1] = '00'; return (int) implode($cents); } $amount = '10,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.0070.00716.75
8.3.50.0140.00722.11
8.3.40.0140.00018.66
8.3.30.0110.00419.13
8.3.20.0080.00020.10
8.3.10.0000.00821.76
8.3.00.0050.00321.03
8.2.180.0180.00416.35
8.2.170.0040.01122.96
8.2.160.0100.00722.09
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0000.00719.66
8.2.110.0030.00720.87
8.2.100.0040.00717.91
8.2.90.0030.00519.40
8.2.80.0050.00220.53
8.2.70.0060.00317.63
8.2.60.0030.00617.50
8.2.50.0050.00317.75
8.2.40.0040.00419.33
8.2.30.0060.00317.75
8.2.20.0070.00017.57
8.2.10.0000.00818.11
8.2.00.0000.00817.75
8.1.280.0040.01125.92
8.1.270.0060.00320.61
8.1.260.0030.00526.35
8.1.250.0000.00828.09
8.1.240.0040.00422.20
8.1.230.0040.00720.72
8.1.220.0080.00017.79
8.1.210.0000.00818.80
8.1.200.0040.00417.11
8.1.190.0050.00317.00
8.1.180.0060.00318.10
8.1.170.0050.00218.98
8.1.160.0080.00018.88
8.1.150.0050.00218.95
8.1.140.0000.00817.40
8.1.130.0000.00717.87
8.1.120.0000.00717.36
8.1.110.0040.00417.53
8.1.100.0040.00417.34
8.1.90.0050.00317.53
8.1.80.0070.00017.48
8.1.70.0030.00317.38
8.1.60.0000.00817.50
8.1.50.0030.00517.51
8.1.40.0050.00317.43
8.1.30.0050.00317.62
8.1.20.0080.00017.59
8.1.10.0090.00017.50
8.1.00.0040.00417.40
8.0.300.0060.00320.08
8.0.290.0040.00416.75
8.0.280.0040.00417.92
8.0.270.0070.00018.00
8.0.260.0030.00317.26
8.0.250.0030.00317.00
8.0.240.0070.00016.88
8.0.230.0030.00316.87
8.0.220.0030.00316.85
8.0.210.0050.00216.80
8.0.200.0030.00316.93
8.0.190.0000.00716.83
8.0.180.0030.00516.91
8.0.170.0040.00416.87
8.0.160.0070.00016.95
8.0.150.0070.00016.79
8.0.140.0000.00716.93
8.0.130.0030.00313.28
8.0.120.0030.00516.86
8.0.110.0070.00016.90
8.0.100.0000.00816.91
8.0.90.0070.00016.84
8.0.80.0090.01216.84
8.0.70.0040.00416.89
8.0.60.0000.00816.76
8.0.50.0040.00416.73
8.0.30.0140.00917.15
8.0.20.0060.01217.41
8.0.10.0040.00416.83
8.0.00.0060.01316.92
7.4.330.0050.00015.09
7.4.320.0030.00316.62
7.4.300.0060.00016.42
7.4.290.0040.00416.61
7.4.280.0040.00716.50
7.4.270.0000.00716.43
7.4.260.0030.00316.63
7.4.250.0000.00716.49
7.4.240.0040.00416.59
7.4.230.0000.00716.67
7.4.220.0130.00916.41
7.4.210.0050.00916.55
7.4.200.0030.00316.34
7.4.160.0120.00616.59
7.4.150.0120.00417.40
7.4.140.0100.01117.86
7.4.130.0140.00416.53
7.4.120.0030.01516.57
7.4.110.0130.00616.64
7.4.100.0120.00816.65
7.4.90.0110.00616.46
7.4.80.0070.01019.39
7.4.70.0090.01216.53
7.4.60.0170.00316.62
7.4.50.0000.00916.70
7.4.40.0130.00316.56
7.4.30.0060.01616.48
7.4.00.0090.00614.63
7.3.330.0030.00313.13
7.3.320.0030.00313.17
7.3.310.0000.00916.26
7.3.300.0030.00316.26
7.3.290.0040.00416.14
7.3.280.0080.00816.32
7.3.270.0090.00917.40
7.3.260.0130.00516.43
7.3.250.0110.00616.40
7.3.240.0080.00816.41
7.3.230.0130.00316.53
7.3.210.0080.00816.26
7.3.200.0140.00719.39
7.3.190.0110.00716.54
7.3.180.0040.01116.51
7.3.170.0120.00816.28
7.3.160.0030.01316.43
7.2.330.0110.00716.79
7.2.320.0100.00616.64
7.2.310.0110.00616.46
7.2.300.0070.01016.68
7.2.290.0060.01116.53
7.2.60.0100.00316.98
7.2.00.0000.01619.62
7.1.200.0080.00415.64
7.1.100.0110.00017.96
7.1.70.0000.00817.20
7.1.60.0100.01319.46
7.1.50.0180.00734.50
7.1.00.0000.08022.27
7.0.200.0980.00414.92
7.0.140.0030.04722.07
7.0.60.0070.08019.98
7.0.50.0100.05717.88
7.0.40.0130.08320.13
7.0.30.0270.07020.30
7.0.20.0230.08720.06
7.0.10.0130.07020.16
7.0.00.0100.06020.32
5.6.280.0030.07720.93
5.6.210.0070.06020.66
5.6.200.0030.04018.13
5.6.190.0030.07020.41
5.6.180.0200.04720.50
5.6.170.0300.04720.66
5.6.160.0100.08020.52
5.6.150.0070.08018.15
5.6.140.0200.05318.30
5.6.130.0030.04318.28
5.6.120.0030.04721.10
5.6.110.0030.08321.05
5.6.100.0200.05320.98
5.6.90.0070.04021.13
5.6.80.0070.07320.39
5.5.350.0200.08020.43
5.5.340.0030.05717.92
5.5.330.0100.04020.31
5.5.320.0270.04020.38
5.5.310.0470.05020.35
5.5.300.0000.04317.99
5.5.290.0030.04318.08
5.5.280.0170.07320.98
5.5.270.0070.05720.79
5.5.260.0100.08020.86
5.5.250.0100.07320.59
5.5.240.0070.07720.13
5.4.450.0230.06019.62
5.4.440.0670.05719.45
5.4.430.0070.06019.36
5.4.420.0170.05719.63
5.4.410.0230.04018.94
5.4.400.0270.04318.85
5.4.390.0200.05718.78
5.4.380.0200.05718.63
5.4.370.0200.05318.58
5.4.360.0230.05018.76
5.4.350.0270.04718.63
5.4.340.0170.05318.56
5.4.320.0130.06018.62
5.4.310.0170.05318.59
5.4.300.0170.05318.46
5.4.290.0130.05718.58
5.4.280.0200.05318.46
5.4.270.0230.04718.80
5.4.260.0330.05718.52
5.4.250.0170.05718.74
5.4.240.0230.04718.77
5.4.230.0200.05018.82
5.4.220.0300.04318.77
5.4.210.0170.05318.82
5.4.200.0200.05016.53
5.4.190.0330.03718.61
5.4.180.0170.06018.74
5.4.170.0100.06018.59
5.4.160.0230.04718.77
5.4.150.0200.05318.67
5.4.140.0200.05316.30
5.4.130.0200.06716.33
5.4.120.0070.06316.22
5.4.110.0130.05016.45
5.4.100.0230.04716.17
5.4.90.0070.06316.31
5.4.80.0070.05716.22
5.4.70.0270.04016.42
5.4.60.0070.06016.14
5.4.50.0230.04716.26
5.4.40.0170.05716.23
5.4.30.0170.04716.18
5.4.20.0100.06016.25
5.4.10.0200.04716.22
5.4.00.0100.05315.71
5.3.290.0170.05714.82
5.3.280.0100.06014.61
5.3.270.0230.04714.80
5.3.260.0170.05314.77
5.3.250.0270.06314.64
5.3.240.0170.05314.81
5.3.230.0200.05314.77
5.3.220.0270.05014.77
5.3.210.0100.05714.69
5.3.200.0170.05014.66
5.3.190.0200.05014.57
5.3.180.0230.04314.77
5.3.170.0170.05714.73
5.3.160.0200.04714.59
5.3.150.0230.04714.54
5.3.140.0200.05014.77
5.3.130.0170.05314.71
5.3.120.0300.04314.66
5.3.110.0170.05314.58
5.3.100.0130.05714.16
5.3.90.0130.06014.16
5.3.80.0330.05314.04
5.3.70.0100.05714.13
5.3.60.0300.04014.21
5.3.50.0070.06014.01
5.3.40.0300.03714.05
5.3.30.0270.06013.98
5.3.20.0370.05013.89
5.3.10.0200.06713.68
5.3.00.0330.06713.71
5.2.170.0230.05011.20
5.2.160.0130.04011.24
5.2.150.0330.02711.25
5.2.140.0170.04011.24
5.2.130.0200.04311.20
5.2.120.0100.04311.13
5.2.110.0070.04711.21
5.2.100.0100.04011.20
5.2.90.0200.03311.20
5.2.80.0100.05011.16
5.2.70.0130.04011.14
5.2.60.0130.04011.03
5.2.50.0130.04711.09
5.2.40.0100.04011.23
5.2.30.0130.04011.09
5.2.20.0100.04310.99
5.2.10.0170.03310.91
5.2.00.0100.04010.70
5.1.60.0070.04010.09
5.1.50.0100.03310.03
5.1.40.0070.04010.01
5.1.30.0130.04310.33
5.1.20.0100.04310.53
5.1.10.0070.04010.15
5.1.00.0100.04010.20
5.0.50.0030.0338.73
5.0.40.0070.0308.59
5.0.30.0100.0438.26
5.0.20.0070.0308.38
5.0.10.0100.0238.26
5.0.00.0070.0438.36
4.4.90.0000.0276.02
4.4.80.0070.0236.00
4.4.70.0070.0236.02
4.4.60.0000.0305.91
4.4.50.0030.0235.90
4.4.40.0030.0375.97
4.4.30.0030.0235.91
4.4.20.0100.0205.93
4.4.10.0070.0235.98
4.4.00.0070.0375.92
4.3.110.0030.0235.86
4.3.100.0070.0235.84
4.3.90.0130.0175.83
4.3.80.0130.0275.78
4.3.70.0030.0235.91
4.3.60.0030.0305.79
4.3.50.0130.0205.80
4.3.40.0100.0335.78
4.3.30.0000.0274.60
4.3.20.0030.0234.54
4.3.10.0000.0234.61
4.3.00.0100.0207.12

preferences:
43.57 ms | 401 KiB | 5 Q