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.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.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.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