3v4l.org

run code in 300+ 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 = preg_replace('/[^0-9\.]/', '', $size); if ($unit) { var_dump(round($size * pow(1024, stripos('bkmgtpezy', $unit[0])))); } else { var_dump(round((float) $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.10.0110.00816.99
8.5.00.0150.00722.10
8.4.150.0010.00214.05
8.4.140.0140.00817.63
8.4.130.0090.01117.93
8.4.120.0090.00820.28
8.4.110.0140.00522.34
8.4.100.0130.00918.05
8.4.90.0150.00618.54
8.4.80.0120.00918.16
8.4.70.0140.00818.28
8.4.60.0130.00918.14
8.4.50.0100.00918.17
8.4.40.0130.00718.09
8.4.30.0130.00320.74
8.4.20.0000.00825.67
8.4.10.0110.00719.88
8.3.280.0110.01118.78
8.3.270.0140.00717.08
8.3.260.0090.01016.86
8.3.250.0130.00619.03
8.3.240.0120.00817.10
8.3.230.0120.00716.67
8.3.220.0070.00116.96
8.3.210.0060.00316.72
8.3.200.0050.00416.66
8.3.190.0100.00916.72
8.3.180.0110.00916.54
8.3.170.0150.00316.72
8.3.160.0130.00616.82
8.3.150.0110.00717.21
8.3.140.0120.00617.01
8.3.130.0030.00618.73
8.3.120.0000.00919.16
8.3.110.0070.01020.94
8.3.100.0090.00018.53
8.3.90.0030.00518.60
8.3.80.0070.00319.36
8.3.70.0090.00616.62
8.3.60.0110.00716.74
8.3.50.0100.00824.54
8.3.40.0060.01019.18
8.3.30.0120.00319.04
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0100.00220.21
8.2.280.0030.00518.34
8.2.270.0060.01217.28
8.2.260.0000.00818.91
8.2.250.0140.00019.00
8.2.240.0030.00619.23
8.2.230.0140.00322.58
8.2.220.0050.00524.06
8.2.210.0190.00026.77
8.2.200.0060.00316.75
8.2.190.0090.00617.13
8.2.180.0150.00325.92
8.2.170.0150.00619.34
8.2.160.0070.00722.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0080.00026.35
8.2.110.0070.00322.32
8.2.100.0120.00018.03
8.2.90.0000.00918.28
8.2.80.0080.00018.03
8.2.70.0080.00418.15
8.2.60.0000.00918.16
8.2.50.0030.00718.10
8.2.40.0080.00019.57
8.2.30.0030.00619.43
8.2.20.0060.00318.07
8.2.10.0040.00419.43
8.2.00.0040.00419.34
8.1.330.0140.00420.44
8.1.320.0100.00916.33
8.1.310.0100.00616.67
8.1.300.0110.00018.12
8.1.290.0060.00318.88
8.1.280.0080.00825.92
8.1.270.0050.00323.99
8.1.260.0090.00028.09
8.1.250.0030.00528.09
8.1.240.0090.00024.03
8.1.230.0060.00621.04
8.1.220.0040.00417.79
8.1.210.0000.00919.96
8.1.200.0040.00717.48
8.1.190.0040.00417.50
8.1.180.0040.00418.10
8.1.170.0000.01018.60
8.1.160.0000.00719.13
8.1.150.0000.00818.77
8.1.140.0000.00718.93
8.1.130.0000.00720.19
8.1.120.0050.00317.66
8.1.110.0080.00017.65
8.1.100.0030.00617.50
8.1.90.0040.00417.52
8.1.80.0000.00817.50
8.1.70.0000.00717.60
8.1.60.0000.00817.79
8.1.50.0000.00817.73
8.1.40.0080.00017.70
8.1.30.0040.00717.91
8.1.20.0000.00817.82
8.1.10.0050.00317.80
8.1.00.0060.00617.74
8.0.300.0080.00020.21
8.0.290.0050.00317.00
8.0.280.0000.00718.44
8.0.270.0030.00316.98
8.0.260.0000.00720.30
8.0.250.0030.00317.29
8.0.240.0000.00717.25
8.0.230.0000.00717.30
8.0.220.0040.00417.13
8.0.210.0070.00016.98
8.0.200.0070.00017.17
8.0.190.0040.00417.21
8.0.180.0050.00217.18
8.0.170.0040.00417.19
8.0.160.0030.00617.13
8.0.150.0030.00516.97
8.0.140.0040.00417.04
8.0.130.0060.00013.59
8.0.120.0040.00417.01
8.0.110.0050.00316.98
8.0.100.0040.00417.06
8.0.90.0070.00017.06
8.0.80.0020.01317.11
8.0.70.0040.00416.92
8.0.60.0050.00216.99
8.0.50.0050.00216.91
8.0.30.0100.01017.41
8.0.20.0090.01017.56
8.0.10.0040.00417.23
8.0.00.0110.00816.89
7.4.330.0020.00215.55
7.4.320.0040.00416.78
7.4.300.0030.00316.80
7.4.290.0000.00816.73
7.4.280.0060.00316.86
7.4.270.0040.00816.80
7.4.260.0000.00513.59
7.4.250.0040.00416.83
7.4.240.0000.00716.71
7.4.230.0000.00816.80
7.4.220.0030.00316.88
7.4.210.0070.00816.86
7.4.200.0030.00316.88
7.4.130.0150.00316.77
7.4.120.0140.00516.76
7.4.110.0100.01016.77
7.4.100.0060.01116.80
7.4.90.0090.00916.91
7.4.80.0030.01716.86
7.4.70.0070.01116.79
7.4.60.0120.00616.76
7.4.50.0160.00316.83
7.4.40.0070.01416.71
7.4.30.0180.00416.59
7.4.20.0130.01216.63
7.4.10.0060.01516.68
7.4.00.0120.00816.71
7.3.330.0040.00416.70
7.3.320.0050.00013.67
7.3.310.0030.00516.71
7.3.300.0070.00016.74
7.3.290.0100.00816.64
7.3.280.0100.01016.57
7.3.260.0130.00716.84
7.3.230.0120.00816.67
7.3.210.0120.00616.58
7.3.200.0130.01316.90
7.3.190.0130.00716.83
7.3.180.0090.01216.86
7.3.170.0100.01416.85
7.3.160.0070.01316.66
7.3.150.0100.00716.66
7.3.140.0140.00916.88
7.3.130.0100.01016.88
7.3.120.0080.01316.59
7.3.110.0070.01216.96
7.3.100.0120.00616.46
7.3.90.0060.01416.74
7.3.80.0080.00816.55
7.3.70.0090.00916.54
7.3.60.0070.01116.67
7.3.50.0100.00716.77
7.3.40.0110.00716.79
7.3.30.0060.01216.84
7.3.20.0480.01016.80
7.3.10.0100.01016.75
7.3.00.0130.00516.72
7.2.330.0070.01117.00
7.2.320.0110.01116.75
7.2.310.0030.01417.14
7.2.300.0090.00917.12
7.2.290.0110.01116.83
7.2.280.0150.01116.99
7.2.270.0150.00816.87
7.2.260.0040.01716.79
7.2.250.0220.00016.96
7.2.240.0100.01017.02
7.2.230.0030.01516.80
7.2.220.0160.00316.69
7.2.210.0100.01016.84
7.2.200.0160.00316.99
7.2.190.0070.01116.81
7.2.180.0120.00616.66
7.2.170.0110.00816.72
7.2.160.0000.01716.81
7.2.150.0140.00717.04
7.2.140.0070.01116.87
7.2.130.0070.01316.88
7.2.120.0130.00617.09
7.2.110.0070.01416.75
7.2.100.0150.00616.96
7.2.90.0140.00616.98
7.2.80.0140.00617.03
7.2.70.0120.00916.90
7.2.60.0110.01416.98
7.2.50.0110.01116.95
7.2.40.0040.01517.10
7.2.30.0150.00416.90
7.2.20.0190.00616.87
7.2.10.0170.00317.02
7.2.00.0120.00916.78

preferences:
162.13 ms | 403 KiB | 5 Q