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.0050.01120.30
8.5.00.0140.00719.89
8.4.150.0030.00014.05
8.4.140.0130.00917.59
8.4.130.0120.00820.21
8.4.120.0120.01020.55
8.4.110.0110.00922.23
8.4.100.0130.00820.32
8.4.90.0140.00618.83
8.4.80.0090.01020.27
8.4.70.0060.00217.82
8.4.60.0130.00719.06
8.4.50.0110.00820.50
8.4.40.0130.01017.45
8.4.30.0040.01520.32
8.4.20.0160.00323.93
8.4.10.0060.00323.66
8.3.280.0130.00818.51
8.3.270.0200.01116.38
8.3.260.0100.01016.54
8.3.250.0110.00918.79
8.3.240.0110.00718.57
8.3.230.0110.00916.51
8.3.220.0020.00618.94
8.3.210.0100.00816.49
8.3.200.0070.00216.49
8.3.190.0130.00517.02
8.3.180.0120.00716.69
8.3.170.0120.00620.56
8.3.160.0070.01116.98
8.3.150.0090.00617.35
8.3.140.0000.01416.34
8.3.130.0030.00618.37
8.3.120.0040.00420.47
8.3.110.0100.01018.13
8.3.100.0080.00016.48
8.3.90.0050.00326.77
8.3.80.0090.00018.43
8.3.70.0120.00616.36
8.3.60.0150.00616.62
8.3.50.0070.00718.32
8.3.40.0000.01420.34
8.3.30.0040.01118.57
8.3.20.0050.00324.18
8.3.10.0040.00424.66
8.3.00.0030.00526.16
8.2.290.0090.01020.62
8.2.280.0100.00918.29
8.2.270.0090.00917.09
8.2.260.0040.00416.65
8.2.250.0070.00718.35
8.2.240.0040.01116.91
8.2.230.0080.00020.94
8.2.220.0000.00824.06
8.2.210.0090.00626.77
8.2.200.0090.00316.25
8.2.190.0070.01016.75
8.2.180.0220.00018.16
8.2.170.0170.00319.01
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0000.01024.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0090.00021.03
8.2.100.0080.00317.72
8.2.90.0080.00017.75
8.2.80.0030.00518.61
8.2.70.0050.00317.38
8.2.60.0050.00317.50
8.2.50.0030.00517.55
8.2.40.0130.00317.62
8.2.30.0100.00717.62
8.2.20.0100.00517.62
8.2.10.0110.00517.62
8.2.00.0150.00317.62
8.1.330.0150.00421.85
8.1.320.0140.00616.18
8.1.310.0080.00018.40
8.1.300.0030.00616.76
8.1.290.0030.00630.84
8.1.280.0160.00325.92
8.1.270.0040.00424.66
8.1.260.0130.00626.35
8.1.250.0080.00028.09
8.1.240.0030.01022.11
8.1.230.0030.00720.85
8.1.220.0000.00818.39
8.1.210.0090.00018.77
8.1.200.0080.00017.41
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0150.00017.62
8.1.160.0120.00617.62
8.1.150.0110.00517.62
8.1.140.0000.01517.62
8.1.130.0150.00217.62
8.1.120.0130.00317.62
8.1.110.0100.00717.62
8.1.100.0130.00417.62
8.1.90.0170.00017.62
8.1.80.0150.00417.62
8.1.70.0120.00417.62
8.1.60.0150.00517.62
8.1.50.0140.00317.62
8.1.40.0150.00317.62
8.1.30.0180.00017.62
8.1.20.0170.00317.62
8.1.10.0110.00617.62
8.1.00.0110.00717.62
8.0.300.0020.00518.77
8.0.290.0040.00416.58
8.0.280.0120.00517.62
8.0.270.0080.00817.62
8.0.260.0170.00017.62
8.0.250.0150.00017.62
8.0.240.0110.00417.62
8.0.230.0110.00517.62
8.0.220.0090.00917.62
8.0.210.0140.00317.62
8.0.200.0150.00217.62
8.0.190.0090.00917.62
8.0.180.0120.00617.62
8.0.170.0120.00417.62
8.0.160.0080.00817.62
8.0.150.0130.00317.62
8.0.140.0110.00617.62
8.0.130.0140.00317.62
8.0.120.0160.00017.62
8.0.110.0080.00817.62
8.0.100.0120.00517.62
8.0.90.0140.00217.62
8.0.80.0140.00317.62
8.0.70.0140.00517.62
8.0.60.0100.00517.62
8.0.50.0160.00017.62
8.0.30.0150.00017.62
8.0.20.0120.00317.62
8.0.10.0080.00817.62

preferences:
116.8 ms | 403 KiB | 5 Q