3v4l.org

run code in 500+ PHP versions simultaneously
<?php function bytes_to_int($size) { var_dump($size); // Remove the non-unit characters from the size. $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-numeric characters from the size. $size = (float) preg_replace('/[^0-9\.]/', '', $size); if ($unit) { var_dump(round($size * pow(1024, stripos('bkmgtpezy', $unit[0])))); } else { var_dump(round($size)); } print "\n\n"; } bytes_to_int('12,2'); bytes_to_int('12,2 b'); bytes_to_int(''); bytes_to_int('m');

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.70.0060.00317.09
8.5.60.0140.00417.03
8.5.50.0140.00518.70
8.5.30.0130.00517.40
8.5.20.0090.00819.48
8.5.10.0110.00716.89
8.5.00.0130.01022.10
8.4.210.0130.00919.68
8.4.180.0110.01021.89
8.4.170.0090.01321.98
8.4.160.0170.01423.64
8.4.150.0070.00516.94
8.4.140.0160.00617.81
8.4.130.0120.00718.97
8.4.120.0110.00924.14
8.4.110.0070.00419.15
8.4.100.0130.00718.90
8.4.90.0090.00320.63
8.4.80.0040.00520.52
8.4.70.0140.00618.70
8.4.60.0140.00619.11
8.4.50.0110.00618.72
8.4.40.0120.00917.77
8.4.30.0130.00620.76
8.4.20.0090.00925.91
8.4.10.0100.01019.59
8.3.300.0130.00818.51
8.3.290.0160.00420.83
8.3.280.0140.00718.57
8.3.270.0110.00916.62
8.3.260.0160.00516.59
8.3.250.0150.00418.77
8.3.240.0100.01117.26
8.3.230.0090.01016.44
8.3.220.0110.00718.88
8.3.210.0070.01316.84
8.3.200.0060.00216.76
8.3.190.0110.00918.73
8.3.180.0070.00819.03
8.3.170.0110.00719.07
8.3.160.0070.01117.20
8.3.150.0150.00416.83
8.3.140.0120.00318.79
8.3.130.0120.00318.71
8.3.120.0000.00818.73
8.3.110.0030.00620.94
8.3.100.0090.00016.75
8.3.90.0080.00018.50
8.3.80.0080.00319.36
8.3.70.0090.00617.00
8.3.60.0180.00316.88
8.3.50.0070.01025.54
8.3.40.0160.00618.95
8.3.30.0110.00418.74
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.300.0120.01222.21
8.2.290.0120.00620.22
8.2.280.0060.00318.71
8.2.270.0060.01216.58
8.2.260.0070.01116.63
8.2.250.0070.00718.56
8.2.240.0080.00019.01
8.2.230.0030.00622.58
8.2.220.0040.00424.06
8.2.210.0160.00326.77
8.2.200.0090.00016.75
8.2.190.0070.01416.58
8.2.180.0160.00325.92
8.2.170.0090.00619.08
8.2.160.0030.01022.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00321.02
8.2.110.0000.01120.55
8.2.100.0040.00817.97
8.2.90.0000.00818.00
8.2.80.0040.00418.98
8.2.70.0050.00317.75
8.2.60.0000.00818.00
8.2.50.0050.00318.05
8.2.40.0000.00818.16
8.2.30.0060.00318.34
8.2.20.0040.00418.19
8.2.10.0000.00719.46
8.2.00.0000.00819.34
8.1.340.0110.01219.79
8.1.330.0110.00821.88
8.1.320.0100.01016.20
8.1.310.0030.00616.48
8.1.300.0040.01218.46
8.1.290.0090.00018.88
8.1.280.0070.00725.92
8.1.270.0050.00323.99
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0090.00022.21
8.1.230.0080.00421.03
8.1.220.0040.00418.88
8.1.210.0040.00418.77
8.1.200.0060.00317.65
8.1.190.0050.00317.47
8.1.180.0040.00418.10
8.1.170.0150.00018.53
8.1.160.0060.00319.04
8.1.150.0000.00718.82
8.1.140.0040.00418.98
8.1.130.0000.00720.18
8.1.120.0000.00817.52
8.1.110.0040.00417.59
8.1.100.0020.00517.64
8.1.90.0040.00417.65
8.1.80.0030.00617.72
8.1.70.0070.00017.57
8.1.60.0040.00417.68
8.1.50.0040.00417.72
8.1.40.0040.00417.76
8.1.30.0060.00317.81
8.1.20.0050.00317.83
8.1.10.0040.00417.73
8.1.00.0090.00017.59
8.0.300.0070.00018.77
8.0.290.0000.00916.88
8.0.280.0040.00420.30
8.0.270.0000.00718.12
8.0.260.0060.00020.29
8.0.250.0070.00017.19
8.0.240.0030.00317.16
8.0.230.0030.00317.09
8.0.220.0040.00416.94
8.0.210.0000.00716.95
8.0.200.0060.00316.98
8.0.190.0040.00417.09
8.0.180.0040.00417.07
8.0.170.0000.00817.08
8.0.160.0040.00416.97
8.0.150.0000.00716.92
8.0.140.0040.00417.03
8.0.130.0030.00313.52
8.0.120.0000.00717.02
8.0.110.0040.00417.05
8.0.100.0040.00417.09
8.0.90.0000.00717.12
8.0.80.0140.00817.05
8.0.70.0070.00017.07
8.0.60.0040.00417.00
8.0.50.0030.00516.99
8.0.30.0090.00917.37
8.0.20.0090.00917.28
8.0.10.0040.00417.12
8.0.00.0030.01617.08
7.4.330.0020.00215.55
7.4.320.0000.00616.86
7.4.300.0030.00316.80
7.4.290.0070.00016.73
7.4.280.0040.00416.77
7.4.270.0030.00716.90
7.4.260.0060.00013.52
7.4.250.0080.00016.75
7.4.240.0030.00316.88
7.4.230.0070.00016.61
7.4.220.0050.00216.91
7.4.210.0100.00816.93
7.4.200.0070.00016.79
7.4.130.0110.01016.77
7.4.120.0080.01116.55
7.4.110.0070.01116.94
7.4.100.0090.00916.68
7.4.90.0120.00616.73
7.4.80.0060.01916.73
7.4.70.0170.00916.88
7.4.60.0130.00716.66
7.4.50.0110.00816.77
7.4.40.0100.01016.63
7.4.30.0060.01216.73
7.4.20.0090.01216.66
7.4.10.0030.01716.59
7.4.00.0060.01316.75
7.3.330.0040.00416.49
7.3.320.0030.00313.51
7.3.310.0030.00316.71
7.3.300.0020.00516.71
7.3.290.0060.00916.57
7.3.280.0070.01316.61
7.3.260.0140.00616.80
7.3.230.0060.01616.70
7.3.210.0030.01416.73
7.3.200.0130.00816.90
7.3.190.0120.00916.60
7.3.180.0090.01516.89
7.3.170.0130.01016.89
7.3.160.0170.00016.99
7.3.150.0120.00616.85
7.3.140.0140.00716.72
7.3.130.0100.01016.86
7.3.120.0030.01516.66
7.3.110.0060.01216.93
7.3.100.0100.01016.62
7.3.90.0120.01216.89
7.3.80.0110.01116.94
7.3.70.0100.00916.68
7.3.60.0050.01416.74
7.3.50.0140.00316.65
7.3.40.0130.00516.85
7.3.30.0060.01116.77
7.3.20.0100.01416.80
7.3.10.0120.00916.70
7.3.00.0260.00016.86
7.2.330.0000.02017.18
7.2.320.0080.01217.05
7.2.310.0050.01616.75
7.2.300.0120.01216.96
7.2.290.0100.01016.77
7.2.280.0130.00717.08
7.2.270.0030.01516.95
7.2.260.0120.00816.85
7.2.250.0090.01016.79
7.2.240.0050.01316.85
7.2.230.0100.01016.96
7.2.220.0210.01616.78
7.2.210.0050.01416.84
7.2.200.0070.01317.02
7.2.190.0090.01016.99
7.2.180.0070.01317.03
7.2.170.0150.00416.79
7.2.160.0050.01416.94
7.2.150.0030.01717.12
7.2.140.0180.00016.79
7.2.130.0090.01316.90
7.2.120.0080.01117.02
7.2.110.0120.00816.87
7.2.100.0100.01016.82
7.2.90.0260.01016.71
7.2.80.0030.01516.80
7.2.70.0090.00916.90
7.2.60.0100.01016.80
7.2.50.0150.00416.89
7.2.40.0160.00316.94
7.2.30.0100.01017.11
7.2.20.0150.00517.06
7.2.10.0050.01516.89
7.2.00.0070.01316.83

preferences:
46.07 ms | 1517 KiB | 5 Q