3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '0x8000000'; $data = substr($data, 2); //remove the 0x prefix from the string $data = str_replace(' ', '', $data); //remove the spaces from the string //$data is now '11210031' $number = hexdec($data); //convert the hexadecimal number to an integer //$number is now 0x11210031 (hexadecimal) = 287375409 (decimal) $nibble1 = ($number >> 28) & 0xF; //shift the number right by 28 bits (each nibble is 4 bits) and select only the last 4 bits (0xF selects all bits in the last nibble) echo "the product number is $nibble1\n"; $nibble2 = ($number >> 24) & 0xF; if ($nibble2 == 1) { echo "this is a new product\n"; } else if ($nibble2 == 2) { echo "this is a used product\n"; }

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.01516.75
8.3.50.0070.01316.60
8.3.40.0120.00918.67
8.3.30.0060.00918.45
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.180.0140.00725.92
8.2.170.0110.00418.79
8.2.160.0110.00322.96
8.2.150.0070.00025.66
8.2.140.0000.00724.66
8.2.130.0070.00026.16
8.2.120.0000.00726.35
8.2.110.0090.00020.55
8.2.100.0070.00417.72
8.2.90.0050.00317.75
8.2.80.0000.00818.78
8.2.70.0070.00318.05
8.2.60.0060.00318.22
8.2.50.0000.00918.10
8.2.40.0040.00421.21
8.2.30.0000.01119.32
8.2.20.0040.00417.98
8.2.10.0070.00019.24
8.2.00.0000.00819.32
8.1.280.0150.00625.92
8.1.270.0070.00023.99
8.1.260.0080.01128.09
8.1.250.0080.00028.09
8.1.240.0110.00021.87
8.1.230.0080.00422.67
8.1.220.0000.00817.78
8.1.210.0090.00018.77
8.1.200.0030.00617.23
8.1.190.0030.00517.22
8.1.180.0000.00818.10
8.1.170.0080.00018.59
8.1.160.0030.00520.63
8.1.150.0000.00818.82
8.1.140.0040.00418.90
8.1.130.0000.00720.17
8.1.120.0040.00417.37
8.1.110.0000.01017.44
8.1.100.0000.00717.47
8.1.90.0040.00417.46
8.1.80.0020.00517.36
8.1.70.0000.00717.44
8.1.60.0030.00617.56
8.1.50.0000.00917.37
8.1.40.0030.00517.42
8.1.30.0050.00217.66
8.1.20.0030.00617.72
8.1.10.0000.00717.49
8.1.00.0040.00417.49
8.0.300.0050.00318.77
8.0.290.0040.00416.75
8.0.280.0040.00418.46
8.0.270.0070.00016.77
8.0.260.0000.00618.39
8.0.250.0090.00016.93
8.0.240.0000.00716.95
8.0.230.0000.00716.96
8.0.220.0000.00816.94
8.0.210.0030.00316.90
8.0.200.0050.00216.90
8.0.190.0000.00816.90
8.0.180.0070.00016.89
8.0.170.0040.00416.91
8.0.160.0040.00416.82
8.0.150.0040.00416.88
8.0.140.0070.00016.84
8.0.130.0030.00313.29
8.0.120.0000.00816.87
8.0.110.0000.00716.84
8.0.100.0000.00716.97
8.0.90.0040.00316.90
8.0.80.0080.00816.89
8.0.70.0040.00416.80
8.0.60.0070.00016.96
8.0.50.0000.00716.86
8.0.30.0250.00816.82
8.0.20.0330.01116.95
8.0.10.0250.01317.05
8.0.00.0240.01417.00
7.4.330.0020.00215.55
7.4.320.0060.00016.62
7.4.300.0060.00016.42
7.4.290.0070.00016.61
7.4.280.0030.00516.52
7.4.270.0070.00016.66
7.4.260.0030.00313.40
7.4.250.0030.00316.49
7.4.240.0040.00316.51
7.4.230.0030.00316.70
7.4.220.0020.00516.51
7.4.210.0070.01216.60
7.4.200.0000.00716.41
7.4.160.0450.00316.64
7.4.150.0240.00716.57
7.4.140.0210.00916.48
7.4.130.0150.01216.48
7.4.120.0160.01016.64
7.4.110.0260.00316.48
7.4.100.0360.01016.48
7.4.90.0420.00416.38
7.4.80.0190.01516.38
7.4.70.0290.01216.37
7.4.60.0170.01216.39
7.4.50.1400.00316.26
7.4.40.0110.01816.25
7.4.30.0290.00316.40
7.4.20.0230.00416.48
7.4.10.0310.01116.50
7.4.00.0190.00816.58
7.3.330.0040.00416.39
7.3.320.0030.00313.09
7.3.310.0040.00416.18
7.3.300.0080.00016.32
7.3.290.0090.00516.35
7.3.280.0130.01516.28
7.3.270.0240.01116.28
7.3.260.0250.01016.22
7.3.250.0220.01316.30
7.3.240.0210.00816.34
7.3.230.0330.00316.34
7.3.220.0460.00916.20
7.3.210.0380.00916.07
7.3.200.0470.00016.15
7.3.190.0250.00816.09
7.3.180.0110.01916.14
7.3.170.0240.00816.20
7.3.160.0250.00816.15
7.3.150.0310.00616.17
7.3.140.0370.00816.21
7.3.130.0220.00716.20
7.3.120.0220.00716.18
7.3.110.0240.00816.11
7.3.100.0200.01416.13
7.3.90.0230.00916.54
7.3.80.0200.00816.28
7.3.70.0160.01216.29
7.3.60.0190.00816.38
7.3.50.0260.00616.28
7.3.40.0240.00716.37
7.3.30.0210.00516.34
7.3.20.0200.00916.38
7.3.10.0310.00416.28
7.3.00.0290.01116.37

preferences:
38.34 ms | 400 KiB | 5 Q