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 << 1)/*, 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.0080.00920.03
8.5.00.0100.01119.58
8.4.160.0140.00923.96
8.4.150.0020.00014.05
8.4.140.0120.00817.61
8.4.130.0120.00917.89
8.4.120.0110.00922.32
8.4.110.0150.00718.93
8.4.100.0090.00117.60
8.4.90.0100.01117.77
8.4.80.0110.00919.41
8.4.70.0050.00317.67
8.4.60.0150.00519.12
8.4.50.0110.00918.49
8.4.40.0090.00917.43
8.4.30.0110.00720.64
8.4.20.0040.00824.24
8.4.10.0030.00623.84
8.3.280.0010.00114.05
8.3.270.0080.01116.51
8.3.260.0070.01116.38
8.3.250.0050.00419.05
8.3.240.0040.00416.51
8.3.230.0120.00816.43
8.3.220.0060.00216.63
8.3.210.0030.00516.42
8.3.200.0130.00616.61
8.3.190.0130.00617.09
8.3.180.0050.00316.59
8.3.170.0040.01418.85
8.3.160.0160.00317.08
8.3.150.0090.00916.99
8.3.140.0110.00716.75
8.3.130.0000.00916.46
8.3.120.0040.00420.65
8.3.110.0000.00818.30
8.3.100.0000.00916.10
8.3.90.0080.00026.77
8.3.80.0030.00617.97
8.3.70.0070.00716.38
8.3.60.0170.00316.50
8.3.50.0040.01116.47
8.3.40.0030.01020.39
8.3.30.0090.00618.30
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0130.00618.97
8.2.280.0070.00316.64
8.2.270.0110.00719.08
8.2.260.0140.00318.09
8.2.250.0030.00518.44
8.2.240.0000.00817.07
8.2.230.0060.00320.94
8.2.220.0000.00924.06
8.2.210.0070.00726.77
8.2.200.0060.00316.50
8.2.190.0090.00616.63
8.2.180.0110.00616.75
8.2.170.0100.00319.01
8.2.160.0100.00722.96
8.2.150.0040.00425.66
8.2.140.0030.00624.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0060.00319.45
8.2.100.0090.00617.78
8.2.90.0000.00817.63
8.2.80.0000.00818.48
8.2.70.0030.00517.59
8.2.60.0070.00017.63
8.2.50.0040.00517.55
8.2.40.0170.00017.62
8.2.30.0120.00417.63
8.2.20.0110.00517.62
8.2.10.0110.00517.62
8.2.00.0130.00217.62
8.1.330.0120.00816.73
8.1.320.0120.00816.11
8.1.310.0080.00018.46
8.1.300.0080.00021.71
8.1.290.0000.00930.84
8.1.280.0140.00725.92
8.1.270.0030.00624.66
8.1.260.0110.00726.35
8.1.250.0050.00328.09
8.1.240.0030.00722.81
8.1.230.0110.00020.90
8.1.220.0000.00918.52
8.1.210.0000.00818.77
8.1.200.0030.00617.53
8.1.190.0030.00617.22
8.1.180.0030.00618.10
8.1.170.0130.00317.62
8.1.160.0050.01017.62
8.1.150.0140.00317.62
8.1.140.0110.00417.62
8.1.130.0140.00517.62
8.1.120.0130.00417.62
8.1.110.0090.00917.62
8.1.100.0110.00617.62
8.1.90.0040.01217.62
8.1.80.0150.00217.62
8.1.70.0160.00317.62
8.1.60.0060.01117.62
8.1.50.0090.00917.62
8.1.40.0180.00017.62
8.1.30.0090.00917.62
8.1.20.0140.00317.62
8.1.10.0090.00917.62
8.1.00.0170.00017.62
8.0.300.0000.00818.77
8.0.290.0040.00416.63
8.0.280.0120.00417.62
8.0.270.0150.00217.62
8.0.260.0130.00417.62
8.0.250.0080.00817.62
8.0.240.0090.00917.62
8.0.230.0160.00017.62
8.0.220.0140.00217.62
8.0.210.0140.00217.62
8.0.200.0120.00617.62
8.0.190.0110.00517.62
8.0.180.0160.00017.62
8.0.170.0130.00317.62
8.0.160.0140.00317.62
8.0.150.0120.00417.62
8.0.140.0080.00817.62
8.0.130.0180.00017.62
8.0.120.0140.00317.62
8.0.110.0120.00617.62
8.0.100.0120.00417.62
8.0.90.0080.00817.62
8.0.80.0040.01317.62
8.0.70.0120.00617.62
8.0.60.0100.00517.62
8.0.50.0100.00517.62
8.0.30.0090.00617.62
8.0.20.0000.01517.62
8.0.10.0160.00017.62

preferences:
113.94 ms | 403 KiB | 5 Q