3v4l.org

run code in 300+ PHP versions simultaneously
<?php function readUnsignedVarLong(string $buffer, int &$offset) : int{ $value = 0; for($i = 0; $i <= 63; $i += 7){ if(!isset($buffer[$offset])){ throw new Exception("No bytes left in buffer"); } $b = ord($buffer[$offset++]); $value |= (($b & 0x7f) << $i); if(($b & 0x80) === 0){ return $value; } } throw new Exception("VarLong did not terminate after 10 bytes!"); } $a = 0; var_dump(0x80 & 0x80, readUnsignedVarLong(str_repeat(chr(255), 9) . chr(0x80), $a));

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.0100.00620.25
8.5.00.0100.01120.27
8.4.160.0140.00623.87
8.4.150.0030.00014.05
8.4.140.0130.00917.77
8.4.130.0100.01018.10
8.4.120.0100.01020.35
8.4.110.0090.00320.32
8.4.100.0120.00917.81
8.4.90.0060.00318.04
8.4.80.0150.00617.97
8.4.70.0100.00918.23
8.4.60.0070.00217.84
8.4.50.0140.01319.66
8.4.40.0120.00818.02
8.4.30.0030.01620.47
8.4.20.0060.00324.21
8.4.10.0080.00023.95
8.3.280.0110.00918.42
8.3.270.0120.00716.41
8.3.260.0150.00516.71
8.3.250.0120.00718.92
8.3.240.0110.00716.57
8.3.230.0140.00616.97
8.3.220.0130.00617.10
8.3.210.0130.00716.73
8.3.200.0110.00916.78
8.3.190.0080.01116.80
8.3.180.0020.00616.78
8.3.170.0040.01418.90
8.3.160.0110.00718.68
8.3.150.0120.00619.12
8.3.140.0040.01116.59
8.3.130.0080.00818.40
8.3.120.0060.00318.82
8.3.110.0110.00420.94
8.3.100.0130.00716.75
8.3.90.0130.00726.77
8.3.80.0070.00717.97
8.3.70.0070.01416.63
8.3.60.0070.01416.63
8.3.50.0070.00718.47
8.3.40.0070.00720.01
8.3.30.0130.00318.84
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.290.0120.00820.23
8.2.280.0140.00416.82
8.2.270.0040.01118.97
8.2.260.0080.00020.58
8.2.250.0030.00617.00
8.2.240.0060.00317.34
8.2.230.0070.01022.58
8.2.220.0100.00024.06
8.2.210.0150.00026.77
8.2.200.0090.00016.88
8.2.190.0140.00716.63
8.2.180.0100.00717.00
8.2.170.0110.01119.09
8.2.160.0070.00722.96
8.2.150.0000.00825.66
8.2.140.0030.00724.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0040.00422.27
8.2.100.0090.00318.03
8.2.90.0060.00317.86
8.2.80.0000.00819.28
8.2.70.0000.00917.63
8.2.60.0000.00817.63
8.2.50.0060.00317.63
8.2.40.0150.00317.62
8.2.30.0060.01117.62
8.2.20.0080.00817.62
8.2.10.0130.00517.62
8.2.00.0160.00017.62
8.1.330.0100.01216.64
8.1.320.0090.01016.01
8.1.310.0070.00716.49
8.1.300.0100.01016.20
8.1.290.0070.00430.84
8.1.280.0140.00725.92
8.1.270.0030.00524.66
8.1.260.0070.00726.35
8.1.250.0000.00828.09
8.1.240.0040.00422.61
8.1.230.0000.01020.89
8.1.220.0040.00417.78
8.1.210.0030.00518.77
8.1.200.0000.00817.53
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0150.00517.62
8.1.160.0140.00417.62
8.1.150.0060.01217.62
8.1.140.0180.00017.62
8.1.130.0090.00917.62
8.1.120.0060.01217.62
8.1.110.0090.00917.62
8.1.100.0250.00017.62
8.1.90.0110.00517.62
8.1.80.0140.00317.62
8.1.70.0150.00217.62
8.1.60.0130.00317.62
8.1.50.0080.00817.62
8.1.40.0120.00617.62
8.1.30.0180.00417.62
8.1.20.0160.00217.62
8.1.10.0080.00817.62
8.1.00.0180.00017.62
8.0.300.0040.00420.13
8.0.290.0040.00416.88
8.0.280.0110.00517.62
8.0.270.0090.00917.62
8.0.260.0130.00317.62
8.0.250.0110.00517.62
8.0.240.0110.00717.62
8.0.230.0170.00017.62
8.0.220.0170.00017.62
8.0.210.0120.00417.62
8.0.200.0080.00817.62
8.0.190.0140.00317.62
8.0.180.0110.00517.62
8.0.170.0070.01017.62
8.0.160.0080.00817.62
8.0.150.0130.00517.62
8.0.140.0170.00017.62
8.0.130.0130.00417.62
8.0.120.0130.00217.62
8.0.110.0180.00017.62
8.0.100.0130.00317.62
8.0.90.0000.01617.62
8.0.80.0140.00517.62
8.0.70.0170.00017.62
8.0.60.0080.00817.62
8.0.50.0110.00817.62
8.0.30.0140.00517.62
8.0.20.0140.00317.62
8.0.10.0090.00917.62

preferences:
35.87 ms | 403 KiB | 5 Q