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(readUnsignedVarLong(str_repeat(chr(255), 8) . 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.0070.01020.23
8.5.00.0130.00820.20
8.4.150.0020.00114.05
8.4.140.0120.01017.62
8.4.130.0050.00517.79
8.4.120.0050.00520.74
8.4.110.0090.01322.25
8.4.100.0130.00918.64
8.4.90.0120.00818.88
8.4.80.0100.01118.91
8.4.70.0060.00318.07
8.4.60.0150.01118.78
8.4.50.0090.00818.89
8.4.40.0160.00717.93
8.4.30.0160.00320.71
8.4.20.0040.00424.01
8.4.10.0000.00923.88
8.3.280.0120.00718.75
8.3.270.0110.00816.83
8.3.260.0090.00816.88
8.3.250.0110.00818.91
8.3.240.0090.00918.88
8.3.230.0110.00816.82
8.3.220.0120.00519.00
8.3.210.0100.01016.97
8.3.200.0030.00616.86
8.3.190.0110.00717.10
8.3.180.0050.00316.74
8.3.170.0100.01020.76
8.3.160.0130.00617.08
8.3.150.0070.01117.14
8.3.140.0090.00916.43
8.3.130.0040.01218.48
8.3.120.0130.00620.48
8.3.110.0070.00318.75
8.3.100.0070.01018.57
8.3.90.0100.01026.77
8.3.80.0100.00018.68
8.3.70.0000.01618.55
8.3.60.0100.01016.59
8.3.50.0160.00616.53
8.3.40.0070.00720.21
8.3.30.0120.00318.76
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0130.00620.47
8.2.280.0110.00718.64
8.2.270.0060.01217.28
8.2.260.0040.01117.00
8.2.250.0130.01018.70
8.2.240.0090.00017.19
8.2.230.0120.00320.94
8.2.220.0140.00724.06
8.2.210.0130.00326.77
8.2.200.0030.00617.00
8.2.190.0110.01116.88
8.2.180.0140.00716.38
8.2.170.0090.00619.15
8.2.160.0130.00322.96
8.2.150.0040.00425.66
8.2.140.0000.01024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0090.00021.07
8.2.100.0060.00618.03
8.2.90.0050.00318.03
8.2.80.0040.00421.13
8.2.70.0050.00317.75
8.2.60.0080.00017.88
8.2.50.0040.00417.75
8.2.40.0110.00517.62
8.2.30.0170.00017.62
8.2.20.0100.00717.62
8.2.10.0120.00517.62
8.2.00.0130.00417.72
8.1.330.0090.01022.11
8.1.320.0110.00616.15
8.1.310.0110.00416.54
8.1.300.0110.00718.26
8.1.290.0060.00330.84
8.1.280.0030.01725.92
8.1.270.0000.00824.66
8.1.260.0120.00626.35
8.1.250.0040.00428.09
8.1.240.0000.01123.70
8.1.230.0060.00622.70
8.1.220.0040.00417.78
8.1.210.0030.00618.77
8.1.200.0040.00417.47
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0170.00017.62
8.1.160.0150.00417.62
8.1.150.0130.00817.62
8.1.140.0090.00917.62
8.1.130.0090.00917.62
8.1.120.0100.00717.62
8.1.110.0140.00517.62
8.1.100.0120.00717.62
8.1.90.0090.00617.62
8.1.80.0130.00317.62
8.1.70.0130.00617.62
8.1.60.0180.00017.62
8.1.50.0160.00017.62
8.1.40.0180.00017.62
8.1.30.0120.00617.62
8.1.20.0140.00417.62
8.1.10.0110.00717.62
8.1.00.0130.01117.62
8.0.300.0000.00719.98
8.0.290.0060.00316.63
8.0.280.0130.00317.62
8.0.270.0100.00517.62
8.0.260.0060.01017.62
8.0.250.0070.01017.62
8.0.240.0060.01017.62
8.0.230.0130.00317.62
8.0.220.0100.00717.62
8.0.210.0090.00617.62
8.0.200.0110.00517.62
8.0.190.0130.00317.62
8.0.180.0140.00317.62
8.0.170.0080.00817.62
8.0.160.0100.00717.62
8.0.150.0130.00317.62
8.0.140.0110.00617.62
8.0.130.0100.00617.62
8.0.120.0140.00317.62
8.0.110.0150.00017.62
8.0.100.0100.00517.62
8.0.90.0130.00317.62
8.0.80.0110.00617.62
8.0.70.0080.00817.62
8.0.60.0130.00317.62
8.0.50.0130.00317.62
8.0.30.0120.00417.62
8.0.20.0120.00417.62
8.0.10.0050.01417.62

preferences:
42.9 ms | 403 KiB | 5 Q