3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Parser { private $chunkSize; private $buffer = ''; private $callback; public function __construct($chunkSize) { $this->chunkSize = $chunkSize; } public function onChunk($callback) { $this->callback = $callback; } public function parse($data) { $this->buffer .= $data; while (strlen($data) >= $this->chunkSize) { $chunk = (string)substr($this->buffer, 0, $this->chunkSize); $this->buffer = (string)substr($this->buffer, $this->chunkSize); call_user_func($this->callback, $chunk); } } } $p = new Parser(43); $p->onChunk(function($data) { echo "Got chunk of data: {$data}\n"; }); $p->parse('The quick brown fox jumps over the lazy dogThe quick brown fox'); $p->parse(' jum'); $p->parse('ps'); $p->parse(' over the lazy dogThe quick brown fox jumps '); $p->parse('over the lazy dog');

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.3.60.0180.00718.05
8.3.50.0110.01321.91
8.3.40.0070.01318.68
8.3.30.0130.00319.05
8.3.20.0060.00320.39
8.3.10.0090.00021.92
8.3.00.0030.00622.40
8.2.180.0080.00816.75
8.2.170.0170.00722.96
8.2.160.0070.01020.98
8.2.150.0060.00324.18
8.2.140.0100.00024.66
8.2.130.0060.00326.16
8.2.120.0100.00019.36
8.2.110.0100.00020.47
8.2.100.0100.00717.84
8.2.90.0080.00017.63
8.2.80.0070.00518.73
8.2.70.0030.00617.75
8.2.60.0030.00517.63
8.2.50.0000.01017.63
8.2.40.0030.00617.62
8.2.30.0030.00619.44
8.2.20.0040.00417.82
8.2.10.0060.00317.88
8.2.00.0000.00917.82
8.1.280.0100.01025.92
8.1.270.0060.00321.82
8.1.260.0030.00626.35
8.1.250.0090.00028.09
8.1.240.0070.00424.01
8.1.230.0030.00919.15
8.1.220.0060.00317.78
8.1.210.0090.00018.77
8.1.200.0080.00017.35
8.1.190.0080.00417.36
8.1.180.0000.01018.95
8.1.170.0000.00917.62
8.1.160.0040.00418.93
8.1.150.0030.00618.73
8.1.140.0130.00017.41
8.1.130.0000.00717.84
8.1.120.0000.00817.57
8.1.110.0000.00817.51
8.1.100.0080.00017.41
8.1.90.0040.00417.42
8.1.80.0040.00417.54
8.1.70.0050.00317.43
8.1.60.0000.00917.70
8.1.50.0050.00317.65
8.1.40.0040.00417.59
8.1.30.0030.00517.69
8.1.20.0030.00617.58
8.1.10.0050.00317.65
8.1.00.0030.00517.53
8.0.300.0000.00918.77
8.0.290.0060.00316.58
8.0.280.0070.00018.31
8.0.270.0080.00017.21
8.0.260.0000.00816.69
8.0.250.0040.00416.75
8.0.240.0000.00816.85
8.0.230.0050.00216.83
8.0.220.0040.00416.72
8.0.210.0000.00716.88
8.0.200.0040.00416.91
8.0.190.0030.00516.95
8.0.180.0080.00016.83
8.0.170.0030.00516.91
8.0.160.0040.00416.90
8.0.150.0000.00816.86
8.0.140.0000.00916.80
8.0.130.0050.00513.27
8.0.120.0000.00816.81
8.0.110.0080.00016.69
8.0.100.0040.00416.64
8.0.90.0030.00616.73
8.0.80.0060.01316.77
8.0.70.0050.00316.74
8.0.60.0000.00816.66
8.0.50.0050.00516.85
8.0.30.0200.01216.99
8.0.20.0180.01217.40
8.0.10.0020.00516.77
8.0.00.0050.02216.69
7.4.330.0000.00715.03
7.4.320.0070.00016.49
7.4.300.0030.00316.46
7.4.290.0030.00616.35
7.4.280.0070.00016.53
7.4.270.0040.00416.41
7.4.260.0070.00016.48
7.4.250.0060.00316.40
7.4.240.0060.00316.32
7.4.230.0040.00416.51
7.4.220.0090.01516.43
7.4.210.0070.01316.42
7.4.200.0050.00316.48
7.4.190.0000.00716.65
7.4.160.0150.00916.32
7.4.150.0220.00917.40
7.4.140.0230.01217.86
7.4.130.0170.01116.43
7.4.120.0140.01916.35
7.4.110.0150.01116.39
7.4.100.0150.01816.36
7.4.90.0140.01016.36
7.4.80.0210.00319.39
7.4.70.0150.00616.27
7.4.60.0070.01616.22
7.4.50.0030.00316.48
7.4.40.0000.01622.77
7.4.30.0130.01716.45
7.4.00.0100.00614.66
7.3.330.0060.00013.20
7.3.320.0000.00613.29
7.3.310.0050.00316.41
7.3.300.0030.00316.26
7.3.290.0060.01216.29
7.3.280.0080.01316.21
7.3.270.0140.01717.40
7.3.260.0290.00316.36
7.3.250.0260.00816.45
7.3.240.0220.00816.29
7.3.230.0180.01716.39
7.3.210.0170.00916.55
7.3.200.0150.01619.39
7.3.190.0170.02716.36
7.3.180.0090.01516.54
7.3.170.0160.00716.27
7.3.160.0130.01016.27
7.3.120.0120.00614.84
7.3.10.0090.00916.57
7.3.00.0090.00616.27
7.2.330.0110.01516.71
7.2.320.0140.01716.77
7.2.310.0250.00616.61
7.2.300.0140.01416.69
7.2.290.0090.01316.78
7.2.130.0070.00317.06
7.2.120.0070.00716.80
7.2.110.0160.00016.97
7.2.100.0110.00416.97
7.2.90.0060.00616.96
7.2.80.0040.00816.95
7.2.70.0040.00817.09
7.2.60.0060.00617.10
7.2.50.0030.00917.00
7.2.40.0060.00616.83
7.2.30.0060.00616.80
7.2.20.0090.00316.93
7.2.10.0030.00916.86
7.2.00.0050.00818.14
7.1.250.0070.00715.91
7.1.100.0090.00318.27
7.1.70.0060.00917.04
7.1.60.0100.01319.82
7.1.50.0060.00616.93
7.0.200.0120.00316.89

preferences:
45.19 ms | 401 KiB | 5 Q