3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); 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(readUnsignedVarLong(str_repeat(chr(255), 9) . chr(255), $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.0110.00620.09
8.5.00.0110.01120.38
8.4.160.0130.01025.75
8.4.150.0010.00114.05
8.4.140.0080.01317.75
8.4.130.0100.01017.86
8.4.120.0100.00920.66
8.4.110.0100.01018.52
8.4.100.0080.01317.80
8.4.90.0110.01017.96
8.4.80.0110.00717.85
8.4.70.0100.01119.82
8.4.60.0040.00519.92
8.4.50.0130.00818.64
8.4.40.0130.00717.60
8.4.30.0090.00920.70
8.4.20.0030.01724.34
8.4.10.0060.00323.86
8.3.280.0070.01218.57
8.3.270.0070.01216.62
8.3.260.0100.01016.76
8.3.250.0110.00718.80
8.3.240.0120.00816.51
8.3.230.0090.00716.84
8.3.220.0060.00917.22
8.3.210.0110.00716.75
8.3.200.0110.00816.89
8.3.190.0040.00417.22
8.3.180.0040.00419.04
8.3.170.0110.00716.78
8.3.160.0160.00617.35
8.3.150.0040.01518.84
8.3.140.0110.00719.15
8.3.130.0030.00618.66
8.3.120.0030.01319.02
8.3.110.0090.00020.94
8.3.100.0060.00324.06
8.3.90.0000.00926.77
8.3.80.0100.00017.97
8.3.70.0150.00018.26
8.3.60.0120.00616.88
8.3.50.0090.00916.98
8.3.40.0100.00320.07
8.3.30.0120.00318.80
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0120.00720.50
8.2.280.0080.00616.91
8.2.270.0040.01516.89
8.2.260.0040.00416.96
8.2.250.0040.00416.63
8.2.240.0090.00017.20
8.2.230.0040.00422.58
8.2.220.0080.00037.54
8.2.210.0070.00726.77
8.2.200.0030.00618.41
8.2.190.0040.01118.54
8.2.180.0100.01018.41
8.2.170.0090.00619.02
8.2.160.0110.00422.96
8.2.150.0080.00025.66
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0030.00621.07
8.2.110.0050.00521.04
8.2.100.0120.00017.91
8.2.90.0000.00818.16
8.2.80.0050.00319.28
8.2.70.0030.00517.88
8.2.60.0050.00317.75
8.2.50.0030.00617.63
8.2.40.0140.00317.62
8.2.30.0120.00617.62
8.2.20.0000.01717.73
8.2.10.0080.00817.63
8.2.00.0080.00817.86
8.1.330.0090.01116.64
8.1.320.0120.00816.36
8.1.310.0110.00716.29
8.1.300.0100.01016.22
8.1.290.0050.00530.84
8.1.280.0090.00925.92
8.1.270.0070.00024.66
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0030.00622.20
8.1.230.0120.00420.71
8.1.220.0000.00817.76
8.1.210.0040.00418.88
8.1.200.0050.00317.63
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0150.00317.62
8.1.160.0130.00417.62
8.1.150.0190.00017.62
8.1.140.0190.00017.62
8.1.130.0140.00317.62
8.1.120.0180.00017.62
8.1.110.0110.00717.62
8.1.100.0120.00617.62
8.1.90.0110.00417.62
8.1.80.0160.00017.62
8.1.70.0170.00017.62
8.1.60.0180.00017.62
8.1.50.0080.00817.62
8.1.40.0110.00517.62
8.1.30.0100.01017.62
8.1.20.0100.01017.62
8.1.10.0150.00317.62
8.1.00.0150.00417.62
8.0.300.0070.00019.98
8.0.290.0000.00816.75
8.0.280.0160.00017.62
8.0.270.0130.00617.62
8.0.260.0170.00017.62
8.0.250.0110.00617.62
8.0.240.0170.00017.62
8.0.230.0060.01217.62
8.0.220.0140.00417.62
8.0.210.0170.00017.62
8.0.200.0140.00317.62
8.0.190.0170.00017.62
8.0.180.0150.00317.62
8.0.170.0060.01117.62
8.0.160.0150.00317.62
8.0.150.0120.00617.62
8.0.140.0120.00517.62
8.0.130.0160.00017.62
8.0.120.0140.00317.62
8.0.110.0130.00317.62
8.0.100.0120.00417.62
8.0.90.0140.00317.62
8.0.80.0130.00317.62
8.0.70.0080.01217.62
8.0.60.0130.00417.62
8.0.50.0080.00817.62
8.0.30.0140.00517.62
8.0.20.0120.00417.62
8.0.10.0180.00017.62

preferences:
36.2 ms | 403 KiB | 5 Q