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!"); } var_dump(readUnsignedVarLong(str_repeat("\255", 10)));

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.00.0100.01119.80
8.4.150.0020.00014.05
8.4.140.0130.00817.50
8.4.130.0130.00720.43
8.4.120.0120.00824.02
8.4.110.0010.00818.40
8.4.100.0060.00318.97
8.4.90.0120.00720.54
8.4.80.0090.01018.64
8.4.70.0110.01018.06
8.4.60.0150.00718.79
8.4.50.0140.00718.81
8.4.40.0100.00717.66
8.4.30.0140.00420.70
8.4.20.0060.00324.23
8.4.10.0040.00423.80
8.3.280.0160.00518.35
8.3.270.0130.00716.72
8.3.260.0140.00616.59
8.3.250.0040.00918.80
8.3.240.0120.00619.01
8.3.230.0050.00316.92
8.3.220.0090.00918.69
8.3.210.0090.01018.44
8.3.200.0040.00516.71
8.3.190.0090.01017.24
8.3.180.0120.00717.04
8.3.170.0120.00620.51
8.3.160.0120.00618.44
8.3.150.0090.00617.02
8.3.140.0110.00716.77
8.3.130.0040.00418.38
8.3.120.0090.00020.91
8.3.110.0090.00620.94
8.3.100.0060.00324.06
8.3.90.0030.00626.77
8.3.80.0030.00717.97
8.3.70.0130.01018.43
8.3.60.0040.01416.75
8.3.50.0150.00616.76
8.3.40.0110.00319.92
8.3.30.0120.00318.69
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0090.00920.55
8.2.280.0120.00618.60
8.2.270.0140.00417.57
8.2.260.0040.01416.65
8.2.250.0000.00816.78
8.2.240.0100.00717.07
8.2.230.0040.00422.58
8.2.220.0090.00037.54
8.2.210.0080.00026.77
8.2.200.0090.00016.88
8.2.190.0090.00618.34
8.2.180.0100.00618.54
8.2.170.0090.00618.83
8.2.160.0090.00422.96
8.2.150.0040.00425.66
8.2.140.0050.00524.66
8.2.130.0000.00726.16
8.2.120.0050.00226.16
8.2.110.0050.00521.02
8.2.100.0090.00617.75
8.2.90.0080.00017.63
8.2.80.0000.00918.83
8.2.70.0040.00417.50
8.2.60.0030.00617.50
8.2.50.0000.00817.55
8.2.40.0110.00517.62
8.2.30.0080.00817.62
8.2.20.0140.00217.62
8.2.10.0170.00017.63
8.2.00.0080.00817.62
8.1.330.0040.00721.98
8.1.320.0130.00618.13
8.1.310.0040.00416.30
8.1.300.0130.00618.06
8.1.290.0030.00630.84
8.1.280.0140.00725.92
8.1.270.0040.00424.66
8.1.260.0110.00726.35
8.1.250.0080.00028.09
8.1.240.0000.00923.88
8.1.230.0040.00717.42
8.1.220.0080.00018.40
8.1.210.0030.00518.77
8.1.200.0100.00017.51
8.1.190.0060.00317.00
8.1.180.0000.00818.10
8.1.170.0050.01017.62
8.1.160.0100.00617.62
8.1.150.0100.00717.62
8.1.140.0110.00417.62
8.1.130.0130.00317.62
8.1.120.0130.00317.62
8.1.110.0120.00617.62
8.1.100.0210.00017.62
8.1.90.0160.00017.62
8.1.80.0080.00817.62
8.1.70.0100.00717.62
8.1.60.0180.00017.62
8.1.50.0120.00517.62
8.1.40.0000.01717.62
8.1.30.0140.00317.62
8.1.20.0150.00417.62
8.1.10.0160.00317.62
8.1.00.0150.00317.62
8.0.300.0040.00418.77
8.0.290.0070.00016.58
8.0.280.0120.00617.62
8.0.270.0050.01117.62
8.0.260.0120.00417.62
8.0.250.0160.00017.62
8.0.240.0120.00417.62
8.0.230.0110.00717.62
8.0.220.0080.00817.62
8.0.210.0120.00617.62
8.0.200.0120.00617.62
8.0.190.0040.01217.62
8.0.180.0160.00017.62
8.0.170.0080.00817.62
8.0.160.0120.00317.62
8.0.150.0150.00017.62
8.0.140.0110.00417.62
8.0.130.0120.00417.62
8.0.120.0160.00317.62
8.0.110.0160.00417.62
8.0.100.0160.00017.62
8.0.90.0100.00517.62
8.0.80.0110.00417.62
8.0.70.0110.00517.62
8.0.60.0060.00917.62
8.0.50.0140.00217.62
8.0.30.0110.00617.62
8.0.20.0130.00417.62
8.0.10.0110.00617.62

preferences:
32.71 ms | 403 KiB | 5 Q