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("\255", 10), $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.0100.00620.23
8.5.00.0150.00920.17
8.4.150.0020.00014.05
8.4.140.0110.00917.71
8.4.130.0050.00417.82
8.4.120.0110.00920.59
8.4.110.0040.00518.98
8.4.100.0090.00917.78
8.4.90.0100.01218.16
8.4.80.0100.00718.30
8.4.70.0050.00617.92
8.4.60.0080.01318.27
8.4.50.0140.00817.67
8.4.40.0150.00617.92
8.4.30.0040.01220.68
8.4.20.0080.00024.06
8.4.10.0060.00323.88
8.3.280.0100.01018.54
8.3.270.0020.00617.00
8.3.260.0070.01016.79
8.3.250.0130.00519.04
8.3.240.0140.00516.48
8.3.230.0150.00416.86
8.3.220.0040.00419.01
8.3.210.0040.00416.68
8.3.200.0120.01016.75
8.3.190.0110.00916.46
8.3.180.0090.00916.86
8.3.170.0150.00318.95
8.3.160.0060.00320.66
8.3.150.0150.00816.99
8.3.140.0090.00619.07
8.3.130.0040.00418.50
8.3.120.0120.00320.87
8.3.110.0090.00018.73
8.3.100.0060.00618.55
8.3.90.0110.00326.77
8.3.80.0040.00418.68
8.3.70.0090.01216.75
8.3.60.0060.01216.88
8.3.50.0140.00716.73
8.3.40.0100.00320.21
8.3.30.0140.00018.87
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0070.00026.16
8.2.290.0150.00320.55
8.2.280.0110.00716.79
8.2.270.0130.00618.84
8.2.260.0090.00018.71
8.2.250.0070.00019.10
8.2.240.0090.00019.00
8.2.230.0040.00420.94
8.2.220.0040.00424.06
8.2.210.0080.00026.77
8.2.200.0060.00316.63
8.2.190.0070.00717.00
8.2.180.0070.01125.92
8.2.170.0040.01118.89
8.2.160.0030.01022.96
8.2.150.0030.00625.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0030.00620.18
8.2.100.0040.00717.97
8.2.90.0030.00618.16
8.2.80.0030.00518.73
8.2.70.0080.00017.63
8.2.60.0040.00417.75
8.2.50.0040.00417.63
8.2.40.0130.00517.62
8.2.30.0070.01117.62
8.2.20.0160.00017.63
8.2.10.0100.00717.63
8.2.00.0080.00817.63
8.1.330.0090.00916.55
8.1.320.0130.01016.39
8.1.310.0140.00018.38
8.1.300.0100.00018.14
8.1.290.0090.00030.84
8.1.280.0100.00725.92
8.1.270.0050.00224.66
8.1.260.0030.01226.35
8.1.250.0050.00328.09
8.1.240.0070.00323.56
8.1.230.0070.00320.83
8.1.220.0040.00418.67
8.1.210.0060.00318.77
8.1.200.0030.00517.53
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0200.00017.62
8.1.160.0100.00717.62
8.1.150.0160.00317.62
8.1.140.0070.01117.62
8.1.130.0150.00217.62
8.1.120.0170.00017.62
8.1.110.0090.00917.62
8.1.100.0150.00217.62
8.1.90.0120.00317.62
8.1.80.0130.00317.62
8.1.70.0140.00417.62
8.1.60.0160.00817.62
8.1.50.0110.00617.62
8.1.40.0100.00717.62
8.1.30.0140.00317.62
8.1.20.0090.00917.62
8.1.10.0170.00017.62
8.1.00.0180.00017.62
8.0.300.0100.00018.77
8.0.290.0000.00816.75
8.0.280.0110.00617.62
8.0.270.0140.00317.62
8.0.260.0120.00617.62
8.0.250.0120.00417.62
8.0.240.0120.00517.62
8.0.230.0080.00817.62
8.0.220.0150.00217.62
8.0.210.0110.00517.62
8.0.200.0100.00617.62
8.0.190.0170.00017.62
8.0.180.0080.00817.62
8.0.170.0120.00417.62
8.0.160.0120.00417.62
8.0.150.0080.00817.62
8.0.140.0130.00317.62
8.0.130.0080.00817.62
8.0.120.0130.00317.62
8.0.110.0150.00017.62
8.0.100.0120.00417.62
8.0.90.0170.00017.62
8.0.80.0140.00417.62
8.0.70.0200.00017.62
8.0.60.0100.00717.62
8.0.50.0120.00417.62
8.0.30.0140.00317.62
8.0.20.0120.00517.62
8.0.10.0100.00717.62

preferences:
42.32 ms | 403 KiB | 5 Q