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)); var_dump($longs); $signBit = (bool) ($longs[0] & 0x80000000); $isSigned = (bool) ($flags & INT_SIGNED); if (is32Bit()) { $result = 0; } else { $result = ($longs[0] << 32) | $longs[1]; if ($signBit && !$isSigned) { $result = (($result & 0x7FFFFFFFFFFFFFFF) * 2) + ~$result + 1; } } return $result; } printf('%f', unpack_int64("\x7F\xFF\xFF\xFF\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.0110.00416.63
8.3.50.0090.01021.93
8.3.40.0040.01118.75
8.3.30.0100.00319.07
8.3.20.0070.00020.34
8.3.10.0000.00723.65
8.3.00.0040.00419.13
8.2.180.0110.00717.98
8.2.170.0070.00722.96
8.2.160.0000.01420.57
8.2.150.0050.00224.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00022.15
8.2.110.0000.01022.20
8.2.100.0040.00718.00
8.2.90.0000.00819.17
8.2.80.0040.00418.02
8.2.70.0060.00317.50
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0040.00418.28
8.2.30.0020.00518.12
8.2.20.0000.00817.80
8.2.10.0000.00718.20
8.2.00.0040.00417.79
8.1.280.0150.00325.92
8.1.270.0040.00423.91
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0070.00323.88
8.1.230.0090.00319.16
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0090.00017.35
8.1.190.0080.00017.30
8.1.180.0000.00818.10
8.1.170.0030.00718.51
8.1.160.0000.00821.98
8.1.150.0050.00318.59
8.1.140.0030.00617.47
8.1.130.0030.00317.85
8.1.120.0000.00717.47
8.1.110.0030.00617.52
8.1.100.0070.00017.41
8.1.90.0050.00317.38
8.1.80.0040.00417.42
8.1.70.0000.00717.44
8.1.60.0000.00817.50
8.1.50.0060.00317.47
8.1.40.0050.00317.53
8.1.30.0050.00317.59
8.1.20.0000.00817.68
8.1.10.0080.00017.53
8.1.00.0040.00417.52
8.0.300.0000.00718.77
8.0.290.0070.00017.18
8.0.280.0040.00418.45
8.0.270.0000.00717.26
8.0.260.0000.00716.96
8.0.250.0070.00016.86
8.0.240.0000.00717.00
8.0.230.0070.00016.87
8.0.220.0030.00516.93
8.0.210.0070.00016.78
8.0.200.0000.00716.96
8.0.190.0030.00616.95
8.0.180.0050.00216.81
8.0.170.0030.00616.82
8.0.160.0040.00416.89
8.0.150.0000.00716.91
8.0.140.0040.00416.88
8.0.130.0060.00013.34
8.0.120.0050.00316.88
8.0.110.0040.00416.88
8.0.100.0000.00816.84
8.0.90.0000.00816.95
8.0.80.0040.01016.86
8.0.70.0080.00016.91
8.0.60.0040.00416.94
8.0.50.0000.00816.76
8.0.30.0110.00717.14
8.0.20.0120.00717.40
8.0.10.0030.00517.14
8.0.00.0120.00916.85
7.4.330.0000.00515.00
7.4.320.0030.00316.62
7.4.300.0030.00316.62
7.4.290.0030.00316.47
7.4.280.0000.00616.50
7.4.270.0030.00316.50
7.4.260.0000.00716.39
7.4.250.0040.00416.42
7.4.240.0030.00316.67
7.4.230.0000.00716.42
7.4.220.0070.01016.43
7.4.210.0080.00716.61
7.4.200.0000.00716.57
7.4.190.0000.00716.61
7.4.160.0150.00316.61
7.4.150.0130.00917.40
7.4.140.0130.00717.86
7.4.130.0080.00916.65
7.4.120.0070.01216.49
7.4.110.0100.00716.34
7.4.100.0100.01016.51
7.4.90.0140.00416.53
7.4.80.0130.01319.39
7.4.70.0100.01016.56
7.4.60.0060.01116.65
7.4.50.0040.00416.40
7.4.40.0070.00422.77
7.4.30.0120.00316.52
7.4.10.0050.01314.77
7.4.00.0070.01015.06
7.3.330.0000.00513.40
7.3.320.0000.00613.39
7.3.310.0070.00016.43
7.3.300.0030.00316.23
7.3.290.0100.01016.37
7.3.280.0080.01016.39
7.3.270.0140.00317.40
7.3.260.0100.00716.59
7.3.250.0110.01016.45
7.3.240.0040.01716.41
7.3.230.0030.01316.40
7.3.210.0080.00816.65
7.3.200.0170.00719.39
7.3.190.0070.01016.32
7.3.180.0070.00816.32
7.3.170.0170.00016.46
7.3.160.0050.01416.39
7.3.130.0050.01415.00
7.3.120.0090.00714.89
7.3.110.0070.01315.01
7.3.100.0050.00814.90
7.3.90.0090.00914.75
7.3.80.0060.00814.71
7.3.70.0060.00614.74
7.3.60.0110.00615.01
7.3.50.0060.00814.67
7.3.40.0060.00814.76
7.3.30.0040.01014.74
7.3.20.0050.01116.72
7.3.10.0050.01016.62
7.3.00.0030.01016.66
7.2.330.0120.00616.78
7.2.320.0060.01116.93
7.2.310.0040.01716.89
7.2.300.0080.01216.45
7.2.290.0090.01516.46
7.2.260.0060.01115.11
7.2.250.0030.01514.96
7.2.240.0070.00714.87
7.2.230.0040.01015.03
7.2.220.0020.01614.87
7.2.210.0050.00815.15
7.2.200.0020.01015.12
7.2.190.0050.00815.00
7.2.180.0080.00614.95
7.2.170.0070.00715.11
7.2.160.0030.01215.06
7.2.150.0050.01016.93
7.2.140.0090.00316.82
7.2.130.0050.01116.86
7.2.120.0050.01116.87
7.2.110.0050.01116.80
7.2.100.0030.01116.65
7.2.90.0130.00216.99
7.2.80.0040.00916.97
7.2.70.0050.01316.71
7.2.60.0090.00616.91
7.2.50.0070.01216.92
7.2.40.0040.01116.94
7.2.30.0080.00517.09
7.2.20.0030.01216.91
7.2.10.0060.01116.98
7.2.00.0050.00917.78
7.1.330.0070.00915.78
7.1.320.0060.00915.95
7.1.310.0020.00715.98
7.1.300.0080.00615.65
7.1.290.0080.00815.89
7.1.280.0090.00516.00
7.1.270.0080.00615.83
7.1.260.0020.00815.92
7.1.250.0040.00815.72
7.1.240.0050.00915.91
7.1.230.0040.01115.77
7.1.220.0070.00715.69
7.1.210.0060.00615.90
7.1.200.0020.00915.73
7.1.190.0030.01015.66
7.1.180.0040.00715.86
7.1.170.0080.00815.91
7.1.160.0050.00715.94
7.1.150.0080.00715.83
7.1.140.0050.00715.94
7.1.130.0040.00615.90
7.1.120.0070.00315.85
7.1.110.0070.00815.98
7.1.100.0060.00916.61
7.1.90.0040.00415.86
7.1.80.0110.00415.78
7.1.70.0050.00816.29
7.1.60.0050.01116.93
7.1.50.0030.00816.25
7.1.40.0030.00715.79
7.1.30.0080.00715.78
7.1.20.0050.01015.59
7.1.10.0080.00315.77
7.1.00.0080.02818.08
7.0.330.0070.00515.47
7.0.320.0090.00315.41
7.0.310.0060.00615.23
7.0.300.0030.01115.51
7.0.290.0040.00715.46
7.0.280.0030.01215.49
7.0.270.0040.01115.46
7.0.260.0070.00715.57
7.0.250.0030.01015.51
7.0.240.0060.00815.52
7.0.230.0060.00715.47
7.0.220.0070.00715.60
7.0.210.0050.00815.56
7.0.200.0070.00715.63
7.0.190.0040.00815.23
7.0.180.0060.00615.52
7.0.170.0020.01315.54
7.0.160.0050.00915.44
7.0.150.0080.00315.53
7.0.140.0030.03017.69
7.0.130.0040.00815.26
7.0.120.0030.00915.52
7.0.110.0060.00415.57
7.0.100.0020.03016.90
7.0.90.0080.01916.97
7.0.80.0070.03217.10
7.0.70.0030.03116.90
7.0.60.0050.02016.94
7.0.50.0050.03617.09
7.0.40.0080.02815.74
7.0.30.0040.01915.63
7.0.20.0060.02615.75
7.0.10.0100.02415.74
7.0.00.0050.03115.66
5.6.400.0050.00714.38
5.6.390.0060.00614.47
5.6.380.0030.00914.41
5.6.370.0050.01114.32
5.6.360.0030.00814.54
5.6.350.0040.00914.35
5.6.340.0060.00914.37
5.6.330.0090.00614.19
5.6.320.0060.00614.30
5.6.310.0090.00314.41
5.6.300.0060.00314.47
5.6.290.0060.00814.35
5.6.280.0060.00914.56
5.6.270.0050.00914.40
5.6.260.0060.00614.44
5.6.250.0070.02516.49
5.6.240.0080.02816.59
5.6.230.0030.02516.61
5.6.220.0080.02716.41
5.6.210.0030.03816.54
5.6.200.0070.02216.59
5.6.190.0040.02716.61
5.6.180.0080.02016.55
5.6.170.0040.03116.69
5.6.160.0050.03416.60
5.6.150.0060.02616.77
5.6.140.0080.02916.72
5.6.130.0080.02716.63
5.6.120.0060.03216.65
5.6.110.0080.01516.49
5.6.100.0040.03016.53
5.6.90.0050.03116.63
5.6.80.0050.01816.41
5.6.70.0030.02116.41
5.6.60.0080.03016.35
5.6.50.0060.02916.43
5.6.40.0050.02116.43
5.6.30.0060.03016.37
5.6.20.0060.03016.27
5.6.10.0040.02916.34
5.6.00.0050.03416.46
5.5.380.0040.03416.54
5.5.370.0100.02716.30
5.5.360.0060.03016.47
5.5.350.0070.03216.41
5.5.340.0060.02616.55
5.5.330.0100.02616.46
5.5.320.0090.02816.56
5.5.310.0030.02116.56
5.5.300.0100.01816.47
5.5.290.0060.03016.58
5.5.280.0070.03416.62
5.5.270.0080.03016.66
5.5.260.0060.02916.46
5.5.250.0050.03016.46
5.5.240.0090.01516.23
5.5.230.0040.02816.25
5.5.220.0050.02416.22
5.5.210.0040.03016.25
5.5.200.0060.02916.25
5.5.190.0080.02816.38
5.5.180.0080.02016.31
5.5.170.0090.00314.38
5.5.160.0070.02916.39
5.5.150.0060.02716.10
5.5.140.0040.02916.22
5.5.130.0050.03116.18
5.5.120.0030.02516.38
5.5.110.0050.02816.12
5.5.100.0050.02216.33
5.5.90.0020.03316.12
5.5.80.0050.02016.25
5.5.70.0070.02415.99
5.5.60.0070.02916.34
5.5.50.0020.03316.13
5.5.40.0050.02116.21
5.5.30.0070.03216.22
5.5.20.0070.02916.07
5.5.10.0080.02916.10
5.5.00.0020.03316.22
5.4.450.0020.03214.06
5.4.440.0030.02814.19
5.4.430.0070.02814.20
5.4.420.0040.03214.10
5.4.410.0090.02914.01
5.4.400.0040.03114.15
5.4.390.0080.02313.98
5.4.380.0050.02813.94
5.4.370.0080.01713.90
5.4.360.0050.02713.92
5.4.350.0040.02114.03
5.4.340.0060.02613.98
5.4.330.0030.00811.50
5.4.320.0040.03014.01
5.4.310.0060.02514.00
5.4.300.0060.02813.93
5.4.290.0040.02114.10
5.4.280.0090.02714.10
5.4.270.0090.02013.93
5.4.260.0050.02613.94
5.4.250.0080.01313.97
5.4.240.0040.02714.01
5.4.230.0070.02614.03
5.4.220.0040.02713.92
5.4.210.0090.02414.06
5.4.200.0060.02813.95
5.4.190.0030.02113.87
5.4.180.0040.03013.95
5.4.170.0020.03414.02
5.4.160.0020.01913.99
5.4.150.0090.02513.90
5.4.140.0080.01713.22
5.4.130.0060.02713.10
5.4.120.0070.02313.13
5.4.110.0060.02613.13
5.4.100.0040.02713.27
5.4.90.0080.01613.09
5.4.80.0010.02113.21
5.4.70.0040.01613.05
5.4.60.0030.02613.10
5.4.50.0030.03313.08
5.4.40.0040.02913.16
5.4.30.0050.01813.10
5.4.20.0050.01513.05
5.4.10.0090.02513.17
5.4.00.0030.02812.89
5.3.290.0060.02512.35
5.3.280.0030.02512.31
5.3.270.0040.02412.41
5.3.260.0110.02612.35
5.3.250.0020.02712.34
5.3.240.0050.02812.32
5.3.230.0060.02812.38
5.3.220.0060.03012.30
5.3.210.0050.02812.36
5.3.200.0040.02712.33
5.3.190.0080.02612.34
5.3.180.0070.02412.31
5.3.170.0010.01912.37
5.3.160.0060.02212.30
5.3.150.0030.02412.41
5.3.140.0010.02312.33
5.3.130.0030.02512.33
5.3.120.0060.02912.34
5.3.110.0100.02212.26
5.3.100.0040.03112.19
5.3.90.0050.02712.12
5.3.80.0040.02012.11
5.3.70.0050.02412.20
5.3.60.0030.02012.20
5.3.50.0050.01512.05
5.3.40.0050.02912.06
5.3.30.0010.03012.11
5.3.20.0040.02312.04
5.3.10.0020.02011.94
5.3.00.0030.02412.05
5.2.170.0030.04311.08
5.2.160.0070.05311.17
5.2.150.0030.05011.06
5.2.140.0070.05711.23
5.2.130.0030.03711.13
5.2.120.0030.06011.04
5.2.110.0070.06010.98
5.2.100.0000.07311.01
5.2.90.0030.06311.04
5.2.80.0070.05011.00
5.2.70.0100.05711.00
5.2.60.0030.06011.14
5.2.50.0030.06311.06
5.2.40.0130.05011.09
5.2.30.0070.05011.11
5.2.20.0030.05711.01
5.2.10.0000.05310.81
5.2.00.0000.05710.76
5.1.60.0070.04310.04
5.1.50.0030.03310.17
5.1.40.0030.04010.07
5.1.30.0000.03710.50
5.1.20.0030.03310.42
5.1.10.0070.05010.19
5.1.00.0000.04010.19
5.0.50.0030.0408.65
5.0.40.0000.0438.36
5.0.30.0000.0608.37
5.0.20.0000.0438.24
5.0.10.0030.0438.30
5.0.00.0000.0678.33
4.4.90.0030.0338.23
4.4.80.0030.0338.23
4.4.70.0000.0208.23
4.4.60.0100.0278.23
4.4.50.0000.0208.23
4.4.40.0030.0508.23
4.4.30.0000.0378.23
4.4.20.0000.0208.23
4.4.10.0030.0138.23
4.4.00.0030.0538.23
4.3.110.0030.0278.23
4.3.100.0070.0308.23
4.3.90.0030.0338.23
4.3.80.0070.0478.23
4.3.70.0070.0178.23
4.3.60.0000.0238.23
4.3.50.0030.0138.23
4.3.40.0030.0208.23
4.3.30.0000.0238.23
4.3.20.0070.0278.23
4.3.10.0000.0308.23
4.3.00.0000.0338.23

preferences:
56.85 ms | 401 KiB | 5 Q