3v4l.org

run code in 300+ PHP versions simultaneously
<?php function string_shift_left($input, $inputlen, $bits, &$output = null) { $skip = $bits / 8; $copylen = $inputlen - $skip; $offset = 8 - ($bits % 8); $mask = 0xff >> $offset; $output = str_pad('', $inputlen + 1, "\x00"); if ($offset == 8) { /* Shifting multiples of 8 allows us to simply copy the relevant bytes */ for ($i = 0; $i < $copylen; $i++) { $output[$i] = $input[$i + $skip]; } return; } for ($i = 0; $i < $copylen; i++) { $output[$i] = chr((ord($input[$i + $skip]) << $offset) | (ord($input[$i + $skip + 1]) & $mask)); } } string_shift_left("\x01", 1, 3, $output); for ($i = 0; $i < strlen($output); $i++) { printf('%08b', ord($output[$i])); }

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)
5.4.270.0170.05018.99
5.4.260.0100.05019.00
5.4.250.0230.07018.65
5.4.240.0130.07718.79
5.4.230.0200.06318.77
5.4.220.0070.08018.96
5.4.210.0070.06019.00
5.4.200.0100.05718.75
5.4.190.0100.05319.09
5.4.180.0070.06018.79
5.4.170.0130.05019.00
5.4.160.0230.04318.75
5.4.150.0100.07718.98
5.4.140.0070.05016.59
5.4.130.0070.06716.47
5.4.120.0100.04716.58
5.4.110.0130.06716.38
5.4.100.0070.07016.56
5.4.90.0100.06716.57
5.4.80.0100.05316.40
5.4.70.0100.06716.37
5.4.60.0130.05316.57
5.4.50.0070.07016.36
5.4.40.0070.07016.52
5.4.30.0130.05016.53
5.4.20.0070.05016.34
5.4.10.0000.08316.54
5.4.00.0000.05715.92
5.3.280.0230.03714.77
5.3.270.0100.06714.61
5.3.260.0170.05014.68
5.3.250.0000.06014.83
5.3.240.0130.04714.61
5.3.230.0130.04714.84
5.3.220.0170.04314.70
5.3.210.0130.04714.40
5.3.200.0100.04714.66
5.3.190.0130.05014.71
5.3.180.0100.05014.73
5.3.170.0130.05714.65
5.3.160.0130.05714.65
5.3.150.0170.06014.65
5.3.140.0000.06014.73
5.3.130.0070.05714.38
5.3.120.0070.07714.57
5.3.110.0170.06314.68
5.3.100.0030.06714.20
5.3.90.0100.05014.08
5.3.80.0030.06014.02
5.3.70.0100.05314.08
5.3.60.0130.04314.09
5.3.50.0030.07313.86
5.3.40.0030.07014.02
5.3.30.0030.06013.97
5.3.20.0030.05313.86
5.3.10.0030.05313.73
5.3.00.0070.07013.71
5.2.170.0230.04311.37
5.2.160.0130.05011.13
5.2.150.0130.05311.15
5.2.140.0130.03311.30
5.2.130.0100.05711.00
5.2.120.0070.04311.06
5.2.110.0130.05011.01
5.2.100.0030.05310.92
5.2.90.0070.03711.08
5.2.80.0030.05311.27
5.2.70.0030.06011.27
5.2.60.0130.04711.02
5.2.50.0100.05711.10
5.2.40.0100.05711.18
5.2.30.0170.05010.97
5.2.20.0070.04310.95
5.2.10.0030.05010.69
5.2.00.0070.06010.94
5.1.60.0030.03710.05
5.1.50.0100.03010.06
5.1.40.0230.0339.94
5.1.30.0030.05710.29
5.1.20.0070.03710.42
5.1.10.0070.04310.27
5.1.00.0000.05710.13
5.0.50.0100.0308.62
5.0.40.0070.0378.42
5.0.30.0100.0478.29
5.0.20.0100.0338.16
5.0.10.0100.0278.25
5.0.00.0000.0578.24
4.4.90.0030.0275.86
4.4.80.0000.0275.84
4.4.70.0030.0235.84
4.4.60.0070.0275.96
4.4.50.0030.0235.93
4.4.40.0070.0405.81
4.4.30.0070.0235.84
4.4.20.0000.0335.97
4.4.10.0000.0235.88
4.4.00.0070.0335.88
4.3.110.0030.0335.79
4.3.100.0000.0235.80
4.3.90.0030.0305.72
4.3.80.0000.0375.72
4.3.70.0100.0235.75
4.3.60.0030.0205.73
4.3.50.0030.0235.74
4.3.40.0030.0405.71
4.3.30.0000.0305.61
4.3.20.0000.0235.61
4.3.10.0100.0275.61
4.3.00.0170.0237.38

preferences:
140.17 ms | 1394 KiB | 7 Q