3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('INT_SIGNED', 1); define('INT_LE', 2); function is32Bit() { $test = unpack('N', "\xFF\xFF\xFF\xFF"); return current($test) === -1; } function unpack_int32($str, $flags = 0) { $length = strlen($str); if ($length < 4) { return false; } else if ($length > 4) { $str = substr($str, 0, 4); } if ($flags & INT_LE) { $str = strrev($str); } $result = unpack('N', $str); $result = current($result); $signBit = (bool) ($result & 0x80000000); $isSigned = (bool) ($flags & INT_SIGNED); $is32bit = is32Bit(); if ($signBit && $isSigned && !$is32bit) { $result = (0x00000000FFFFFFFF << 32) | $result; } else if ($signBit && !$isSigned && $is32bit) { $result = (($result & 0x7FFFFFFF) * 2) + ~$result + 1; } return $result; } function unpack_int64($str, $flags = 0) { $length = strlen($str); if ($length < 8) { return false; } else if ($length > 8) { $str = substr($str, 0, 8); } if ($flags & INT_LE) { $str = strrev($str); } $longs = array_values(unpack('N*', $str)); $signBit = (bool) ($longs[0] & 0x80000000); $isSigned = (bool) ($flags & INT_SIGNED); if (is32Bit()) { if ($isSigned) { } else { if ($longs[0] & 0x80000000) { $longs[0] = (($longs[0] & 0x7FFFFFFF) * 2) + ~$longs[0] + 1; } if ($longs[1] & 0x80000000) { $longs[1] = (($longs[1] & 0x7FFFFFFF) * 2) + ~$longs[1] + 1; } $result = ($longs[0] * pow(2, 32)) + $longs[1]; } } else { $result = ($longs[0] << 32) | $longs[1]; if ($signBit && !$isSigned) { $result = (($result & 0x7FFFFFFFFFFFFFFF) * 2) + ~$result + 1; } } return $result; } printf('%f', unpack_int64("\x00\x00\x00\x07\xFF\xFF\xFF\xFF"));

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.0150.00318.43
8.3.50.0050.01421.93
8.3.40.0040.01118.71
8.3.30.0040.01118.71
8.3.20.0000.00818.66
8.3.10.0150.00020.53
8.3.00.0040.00421.80
8.2.180.0130.00716.38
8.2.170.0090.00622.96
8.2.160.0050.00820.35
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0060.00326.16
8.2.120.0000.00819.48
8.2.110.0090.00022.13
8.2.100.0040.00817.82
8.2.90.0030.00519.21
8.2.80.0080.00018.03
8.2.70.0040.00417.75
8.2.60.0030.00618.03
8.2.50.0060.00618.07
8.2.40.0080.00018.16
8.2.30.0030.00619.82
8.2.20.0000.00717.77
8.2.10.0040.00417.75
8.2.00.0030.00617.83
8.1.280.0090.00625.92
8.1.270.0080.00023.99
8.1.260.0070.01026.35
8.1.250.0080.00028.09
8.1.240.0030.00622.61
8.1.230.0080.00420.84
8.1.220.0040.00418.77
8.1.210.0050.00319.04
8.1.200.0000.00917.23
8.1.190.0040.00417.53
8.1.180.0000.00818.10
8.1.170.0040.00418.61
8.1.160.0050.00318.90
8.1.150.0040.00418.57
8.1.140.0040.00417.39
8.1.130.0050.00217.84
8.1.120.0000.00717.40
8.1.110.0060.00317.52
8.1.100.0000.00717.46
8.1.90.0040.00417.41
8.1.80.0000.00717.52
8.1.70.0030.00317.38
8.1.60.0040.00417.48
8.1.50.0040.00417.38
8.1.40.0050.00317.55
8.1.30.0040.00417.66
8.1.20.0040.00417.62
8.1.10.0040.00417.64
8.1.00.0000.00817.55
8.0.300.0040.00419.93
8.0.290.0030.00616.75
8.0.280.0000.00718.46
8.0.270.0000.00817.19
8.0.260.0000.00716.91
8.0.250.0070.00016.96
8.0.240.0000.00816.88
8.0.230.0040.00417.00
8.0.220.0030.00316.94
8.0.210.0000.00816.98
8.0.200.0000.00716.91
8.0.190.0040.00416.97
8.0.180.0030.00316.87
8.0.170.0040.00416.93
8.0.160.0070.00016.83
8.0.150.0090.00016.81
8.0.140.0030.00716.80
8.0.130.0000.00513.30
8.0.120.0000.00816.86
8.0.110.0060.00316.70
8.0.100.0070.00016.91
8.0.90.0000.00716.98
8.0.80.0060.00916.86
8.0.70.0030.00516.93
8.0.60.0040.00416.85
8.0.50.0000.00717.00
8.0.30.0090.01017.01
8.0.20.0110.00917.40
8.0.10.0000.00717.03
8.0.00.0140.00616.68
7.4.330.0050.00014.78
7.4.320.0030.00316.52
7.4.300.0030.00316.66
7.4.290.0050.00316.63
7.4.280.0000.00816.53
7.4.270.0000.00816.38
7.4.260.0000.00613.36
7.4.250.0040.00416.44
7.4.240.0000.00716.56
7.4.230.0030.00316.52
7.4.220.0100.00616.52
7.4.210.0090.00916.61
7.4.200.0040.00416.61
7.4.190.0040.00416.40
7.4.160.0090.00616.57
7.4.150.0100.01417.40
7.4.140.0090.00717.86
7.4.130.0030.01316.45
7.4.120.0100.00716.54
7.4.110.0040.02016.43
7.4.100.0060.01516.68
7.4.90.0090.00916.29
7.4.80.0130.00619.37
7.4.70.0120.00616.45
7.4.60.0130.00916.39
7.4.50.0000.00816.43
7.4.40.0070.00722.27
7.4.30.0150.00316.40
7.4.00.0000.01214.90
7.3.330.0030.00313.39
7.3.320.0030.00313.36
7.3.310.0030.00316.39
7.3.300.0070.00016.29
7.3.290.0100.00316.39
7.3.280.0080.00916.37
7.3.270.0090.00917.40
7.3.260.0110.00518.24
7.3.250.0120.01316.73
7.3.240.0190.00016.29
7.3.230.0120.00616.41
7.3.210.0100.00716.58
7.3.200.0070.01519.39
7.3.190.0030.01416.68
7.3.180.0090.00616.53
7.3.170.0100.00716.74
7.3.160.0160.00616.49
7.3.120.0030.00815.02
7.3.10.0060.01016.64
7.3.00.0080.00316.71
7.2.330.0090.01216.48
7.2.320.0130.00316.92
7.2.310.0090.01016.58
7.2.300.0070.01016.84
7.2.290.0060.00916.67
7.2.130.0080.00516.96
7.2.120.0080.00616.78
7.2.110.0030.00716.75
7.2.100.0040.00716.70
7.2.90.0070.00716.93
7.2.80.0030.00916.96
7.2.70.0020.00916.86
7.2.60.0050.00717.04
7.2.50.0060.01016.89
7.2.40.0020.00817.12
7.2.30.0050.00716.93
7.2.20.0060.00916.89
7.2.10.0040.00716.69
7.2.00.0070.00717.76
7.1.250.0000.01115.80
7.1.100.0030.00918.22
7.1.70.0000.00917.30
7.1.60.0110.01119.40
7.1.50.0000.02116.93
7.1.00.0030.07322.54
7.0.200.0080.00016.93
7.0.140.0000.07722.02
7.0.60.0130.07720.07
7.0.50.0030.04718.02
7.0.40.0100.04017.86
7.0.30.0070.08717.76
7.0.20.0170.05017.84
7.0.10.0030.06317.72
7.0.00.0100.08317.74
5.6.280.0030.07321.12
5.6.210.0200.06720.62
5.6.200.0070.04318.19
5.6.190.0100.05018.25
5.6.180.0100.07018.17
5.6.170.0030.08018.15
5.6.160.0100.03718.29
5.6.150.0100.03718.15
5.6.140.0130.08018.29
5.6.130.0070.04718.14
5.6.120.0070.06718.16
5.6.110.0100.08318.21
5.6.100.0030.07718.19
5.6.90.0130.07718.20
5.6.80.0100.07317.57
5.6.70.0100.06717.63
5.6.60.0130.06717.50
5.6.50.0070.07717.57
5.6.40.0070.08017.52
5.6.30.0000.08717.61
5.6.20.0070.06717.63
5.6.10.0100.07317.64
5.6.00.0170.07017.61
5.5.350.0300.07720.36
5.5.340.0070.06717.94
5.5.330.0070.05018.04
5.5.320.0100.07718.01
5.5.310.0030.08017.97
5.5.300.0000.05317.99
5.5.290.0170.07717.95
5.5.280.0030.05018.04
5.5.270.0030.08017.96
5.5.260.0030.08318.06
5.5.250.0100.06717.77
5.5.240.0000.08017.47
5.5.230.0030.07017.39
5.5.220.0030.05017.45
5.5.210.0130.07017.46
5.5.200.0100.06717.38
5.5.190.0000.05717.43
5.5.180.0000.06317.34
5.5.160.0030.04017.32
5.5.150.0100.07717.43
5.5.140.0130.07317.31
5.5.130.0030.08717.42
5.5.120.0030.06317.31
5.5.110.0100.06717.28
5.5.100.0130.07317.26
5.5.90.0100.06317.20
5.5.80.0070.08017.24
5.5.70.0030.08317.21
5.5.60.0030.06717.33
5.5.50.0030.07017.18
5.5.40.0100.07017.23
5.5.30.0000.08017.20
5.5.20.0170.06317.21
5.5.10.0000.04717.32
5.5.00.0030.05017.22
5.4.450.0070.05319.43
5.4.440.0070.04719.36
5.4.430.0030.08019.46
5.4.420.0070.06319.34
5.4.410.0030.05319.25
5.4.400.0070.07019.13
5.4.390.0100.08019.12
5.4.380.0070.07719.13
5.4.370.0100.05019.27
5.4.360.0070.07718.91
5.4.350.0070.07719.05
5.4.340.0170.06319.02
5.4.320.0030.04318.99
5.4.310.0070.06719.02
5.4.300.0130.07718.95
5.4.290.0100.07319.11
5.4.280.0030.07319.03
5.4.270.0030.07318.89
5.4.260.0100.08019.13
5.4.250.0070.08019.09
5.4.240.0130.07318.95
5.4.230.0070.08019.05
5.4.220.0030.07719.02
5.4.210.0100.04318.95
5.4.200.0030.08719.27
5.4.190.0070.08019.01
5.4.180.0100.06319.11
5.4.170.0100.04719.02
5.4.160.0100.05719.03
5.4.150.0070.07319.01
5.4.140.0030.04716.48
5.4.130.0000.07716.59
5.4.120.0100.05716.43
5.4.110.0100.07316.65
5.4.100.0030.06316.29
5.4.90.0170.06316.64
5.4.80.0000.06716.33
5.4.70.0100.07016.59
5.4.60.0070.07016.31
5.4.50.0070.05316.43
5.4.40.0030.06716.43
5.4.30.0070.04316.42
5.4.20.0100.07716.55
5.4.10.0130.05016.36
5.4.00.0100.06315.98
5.3.290.0070.04014.74
5.3.280.0130.05314.47
5.3.270.0070.06314.48
5.3.260.0070.04314.68
5.3.250.0070.07314.63
5.3.240.0100.04014.61
5.3.230.0100.03314.66
5.3.220.0000.08014.45
5.3.210.0030.05314.64
5.3.200.0070.05014.67
5.3.190.0030.05314.63
5.3.180.0030.07714.70
5.3.170.0200.04314.80
5.3.160.0030.06014.61
5.3.150.0130.04714.64
5.3.140.0100.07314.62
5.3.130.0100.05714.64
5.3.120.0170.04314.62
5.3.110.0000.05314.61
5.3.100.0170.07013.91
5.3.90.0170.02714.06
5.3.80.0070.06014.08
5.3.70.0100.07314.25
5.3.60.0030.07713.91
5.3.50.0170.06313.95
5.3.40.0130.05014.04
5.3.30.0070.04313.95
5.3.20.0100.06013.73
5.3.10.0070.07313.66
5.3.00.0100.06313.67
5.2.170.0070.03711.27
5.2.160.0070.04011.07
5.2.150.0070.04711.22
5.2.140.0070.05311.13
5.2.130.0100.04010.98
5.2.120.0030.04011.18
5.2.110.0070.06311.12
5.2.100.0070.06011.19
5.2.90.0070.05711.34
5.2.80.0070.05311.34
5.2.70.0000.05711.17
5.2.60.0030.04311.16
5.2.50.0030.03011.01
5.2.40.0000.06710.87
5.2.30.0030.04711.04
5.2.20.0030.03311.06
5.2.10.0070.05311.10
5.2.00.0070.04710.85
5.1.60.0030.03010.00
5.1.50.0030.02710.16
5.1.40.0070.03310.03
5.1.30.0070.05710.39
5.1.20.0030.04710.29
5.1.10.0030.05010.19
5.1.00.0000.05310.23
5.0.50.0000.0239.15
5.0.40.0000.0209.15
5.0.30.0070.0239.15
5.0.20.0000.0209.15
5.0.10.0000.0209.15
5.0.00.0000.0309.15
4.4.90.0000.0309.15
4.4.80.0070.0179.15
4.4.70.0030.0339.15
4.4.60.0070.0239.15
4.4.50.0070.0209.15
4.4.40.0030.0339.15
4.4.30.0030.0209.15
4.4.20.0070.0339.15
4.4.10.0030.0379.15
4.4.00.0000.0279.15
4.3.110.0030.0139.15
4.3.100.0000.0179.15
4.3.90.0000.0139.15
4.3.80.0030.0209.15
4.3.70.0030.0139.15
4.3.60.0000.0139.15
4.3.50.0000.0179.15
4.3.40.0030.0309.15
4.3.30.0030.0139.15
4.3.20.0070.0109.15
4.3.10.0000.0139.15
4.3.00.0000.0139.15

preferences:
40.68 ms | 401 KiB | 5 Q