3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "int cast: ",(int)(0xffffffffffffffff & 0xffff); // -1 printf("\nprintf: %d\n",0xffffffff); // treat as a signed number -- first gets cast to an int? echo "hexdec: "; var_dump((int) hexdec("ffffffff")); printf("\nprintf max int in hex: %x\n",PHP_INT_MAX); echo 0x5,"\n"; echo ~0x5 + 1,"\n"; // transform to -5 $n = sprintf("0x%x", (pow(2,32) - 5) ); // get 2s complement var_dump($n); $i = intval($n + 0); // trick that doesn't work anymore with PHP 7 echo $i; var_dump($i); printf("%x",$i); // display binary as hex $r = 0xffffffff & 0xfffffffb; // anding to simplify var_dump($r); echo 0xfb - pow(2,8); // to detect value of hex printf("\n%x\n",(pow(2, 32) - 5)); echo (5 + 0xfffffffb) == pow(2,32)? 'true':'false'; // floats both echo "\n",0xfffffffb > 0x7fffffff? 'true':'false';

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.0120.00719.91
8.5.00.0110.01120.32
8.4.160.0110.01220.32
8.4.150.0010.00114.05
8.4.140.0120.00917.54
8.4.130.0080.00219.01
8.4.120.0120.00518.79
8.4.110.0100.01218.91
8.4.100.0120.00817.91
8.4.90.0110.00920.68
8.4.80.0100.01018.84
8.4.70.0130.00820.66
8.4.60.0120.00820.67
8.4.50.0110.00918.91
8.4.40.0100.00719.59
8.4.30.0150.00317.79
8.4.20.0100.01017.83
8.4.10.0090.00017.79
8.3.280.0120.00818.59
8.3.270.0100.01116.93
8.3.260.0130.00416.66
8.3.250.0110.00816.80
8.3.240.0040.00416.74
8.3.230.0050.00316.97
8.3.220.0050.00720.68
8.3.210.0100.00516.81
8.3.200.0070.00216.68
8.3.190.0040.00419.00
8.3.180.0070.01319.23
8.3.170.0130.00617.07
8.3.160.0180.00016.73
8.3.150.0130.00716.89
8.3.140.0140.00417.15
8.3.130.0050.00318.46
8.3.120.0160.00020.82
8.3.110.0060.00320.94
8.3.100.0090.00024.06
8.3.90.0030.00526.77
8.3.80.0090.00017.97
8.3.70.0130.00318.43
8.3.60.0060.01218.40
8.3.50.0120.01122.12
8.3.40.0120.00618.82
8.3.30.0170.00318.96
8.3.20.0000.00720.43
8.3.10.0080.00020.57
8.3.00.0040.00420.48
8.2.290.0130.00617.43
8.2.280.0100.01118.66
8.2.270.0080.01116.73
8.2.260.0000.00816.94
8.2.250.0040.00416.84
8.2.240.0040.00417.52
8.2.230.0090.00022.58
8.2.220.0000.00737.54
8.2.210.0000.00726.77
8.2.200.0040.00418.66
8.2.190.0100.00717.00
8.2.180.0070.00718.66
8.2.170.0000.01422.96
8.2.160.0080.00620.56
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00419.38
8.2.120.0090.00026.35
8.2.110.0030.00721.07
8.2.100.0090.00317.97
8.2.90.0040.00418.09
8.2.80.0060.00318.03
8.2.70.0040.00417.75
8.2.60.0110.00317.78
8.2.50.0060.00318.09
8.2.40.0040.00420.56
8.2.30.0040.00421.32
8.2.20.0000.00717.86
8.2.10.0000.00718.17
8.2.00.0070.00018.23
8.1.330.0150.00416.39
8.1.320.0080.01122.05
8.1.310.0090.00616.37
8.1.300.0090.00020.34
8.1.290.0030.00630.84
8.1.280.0070.01425.92
8.1.270.0050.00223.99
8.1.260.0030.00528.09
8.1.250.0040.00428.09
8.1.240.0130.01022.67
8.1.230.0030.00721.04
8.1.220.0040.00417.89
8.1.210.0030.00519.10
8.1.200.0100.00017.35
8.1.190.0000.00917.36
8.1.180.0030.00518.10
8.1.170.0060.00318.63
8.1.160.0040.00421.07
8.1.150.0040.00418.92
8.1.140.0040.00419.65
8.1.130.0030.00317.75
8.1.120.0000.00717.59
8.1.110.0040.00417.52
8.1.100.0030.00517.61
8.1.90.0030.00517.59
8.1.80.0070.00017.55
8.1.70.0040.00417.56
8.1.60.0050.00317.70
8.1.50.0040.00417.68
8.1.40.0050.00317.57
8.1.30.0000.00817.76
8.1.20.0090.00017.78
8.1.10.0040.00417.64
8.1.00.0080.00017.53
8.0.300.0000.00720.21
8.0.290.0000.00717.00
8.0.280.0000.00718.60
8.0.270.0000.00717.32
8.0.260.0070.00017.36
8.0.250.0000.00717.13
8.0.240.0040.00417.11
8.0.230.0050.00317.05
8.0.220.0040.00416.88
8.0.210.0030.00317.02
8.0.200.0000.00717.09
8.0.190.0000.00816.93
8.0.180.0070.00017.07
8.0.170.0050.00316.91
8.0.160.0080.00016.98
8.0.150.0000.00817.04
8.0.140.0040.00416.81
8.0.130.0030.00313.38
8.0.120.0080.00017.04
8.0.110.0000.00717.07
8.0.100.0060.00316.95
8.0.90.0040.00416.89
8.0.80.0100.00516.96
8.0.70.0040.00416.85
8.0.60.0000.00817.18
8.0.50.0000.00817.13
8.0.30.0090.01117.39
8.0.20.0140.00617.40
8.0.10.0000.00817.15
8.0.00.0090.01316.86
7.4.330.0000.00516.80
7.4.320.0040.00416.53
7.4.300.0000.00616.63
7.4.290.0070.00016.74
7.4.280.0050.00316.67
7.4.270.0040.00416.56
7.4.260.0000.00716.68
7.4.250.0050.00316.77
7.4.240.0000.00716.75
7.4.230.0000.00716.80
7.4.220.0060.01416.81
7.4.210.0050.00916.59
7.4.200.0070.00016.75
7.4.160.0060.00916.66
7.4.150.0100.00717.40
7.4.140.0110.01117.86
7.4.130.0130.00816.84
7.4.120.0100.01016.63
7.4.110.0040.01416.69
7.4.100.0120.00616.71
7.4.90.0120.00616.88
7.4.80.0060.01919.39
7.4.70.0160.00016.73
7.4.60.0070.01016.68
7.4.50.0080.01116.85
7.4.40.0100.00616.41
7.4.30.0030.01316.54
7.4.00.0000.01415.30
7.3.330.0000.00613.27
7.3.320.0080.00013.29
7.3.310.0000.00616.34
7.3.300.0070.00016.42
7.3.290.0000.00816.44
7.3.280.0060.01016.42
7.3.270.0140.00317.40
7.3.260.0040.01516.48
7.3.250.0110.00916.52
7.3.240.0120.00616.51
7.3.230.0080.01116.53
7.3.210.0100.00716.50
7.3.200.0150.00819.39
7.3.190.0070.01016.64
7.3.180.0100.01016.53
7.3.170.0130.01016.40
7.3.160.0000.01716.71
7.3.10.0000.01516.95
7.3.00.0040.01116.80
7.2.330.0070.01116.82
7.2.320.0070.01016.78
7.2.310.0140.00616.48
7.2.300.0120.00616.88
7.2.290.0000.01716.68
7.2.130.0060.00616.86
7.2.120.0070.01016.99
7.2.110.0070.00316.99
7.2.100.0130.01017.09
7.2.90.0030.01017.02
7.2.80.0060.00316.98
7.2.70.0100.00716.94
7.2.60.0090.00616.98
7.2.50.0030.00916.97
7.2.40.0090.00317.10
7.2.30.0110.00017.10
7.2.20.0110.01117.00
7.2.10.0140.00717.17
7.2.00.0060.00916.97
7.1.250.0160.00615.97
7.1.200.0070.00715.99
7.1.70.0070.00416.96
7.1.60.0090.01619.77
7.1.50.0040.00717.17
7.1.00.0100.06722.42
7.0.200.0120.00615.21
7.0.60.0330.05720.10
7.0.50.0030.04017.88
7.0.40.0130.07320.19
7.0.30.0200.05320.06
7.0.20.0130.05320.23
7.0.10.0100.08720.28
7.0.00.0200.07320.10
5.6.280.0070.06720.81
5.6.210.0130.06320.82
5.6.200.0130.07018.34
5.6.190.0030.04320.79
5.6.180.0300.05020.63
5.6.170.0330.06320.64
5.6.160.0000.04720.44
5.6.150.0030.04018.35
5.6.140.0130.03718.17
5.6.130.0000.06018.33
5.6.120.0200.07021.24
5.6.110.0130.06721.14
5.6.100.0130.07721.06
5.6.90.0000.04721.18
5.6.80.0070.06320.48
5.5.350.4200.04320.48
5.5.340.0030.07718.12
5.5.330.0130.08720.27
5.5.320.0300.03720.32
5.5.310.0230.05320.46
5.5.300.0130.07318.02
5.5.290.0030.04718.10
5.5.280.0030.04321.10
5.5.270.0030.04020.92
5.5.260.0200.06320.86
5.5.250.0100.03320.71
5.5.240.0200.04020.27

preferences:
180.01 ms | 403 KiB | 5 Q