3v4l.org

run code in 500+ PHP versions simultaneously
<?php use function PHPStan\dumpType; final class SinglePickSKU { public function renderEditControls(string $id): string { preg_match('/(\d+)$/', $id, $result); $counter = ''; if (is_numeric($result[1])) { if ($result[1] < 10) { $counter = '0' . $result[1] . '. '; } else { $counter = $result[1] . '. '; } } var_dump($counter); $html = ''; $html .= doFoo($counter . 'abc'); return $html; } } function doFoo(string $s):string { return $s; } $s = new SinglePickSKU(); $s->renderEditControls('');

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.100.0030.00417.20
8.5.90.0130.00717.41
8.5.80.0130.00617.27
8.5.70.0110.00817.35
8.5.60.0120.00617.15
8.5.50.0150.00517.03
8.5.40.0100.01116.87
8.5.30.0100.00417.09
8.5.20.0090.01117.27
8.5.10.0060.00617.20
8.5.00.0110.00517.11
8.4.250.0080.00719.87
8.4.240.0130.01019.98
8.4.230.0130.00619.98
8.4.220.0100.00319.92
8.4.210.0080.00519.71
8.4.200.0140.00819.85
8.4.190.0140.01020.04
8.4.180.0120.01020.00
8.4.170.0100.00520.06
8.4.160.0090.00220.07
8.4.150.0150.00720.01
8.4.140.0130.00518.09
8.4.130.0080.00717.95
8.4.120.0070.00418.02
8.4.110.0090.00318.34
8.4.100.0070.00318.27
8.4.90.0090.00318.23
8.4.80.0110.00818.07
8.4.70.0200.00518.16
8.4.60.0070.00518.16
8.4.50.0060.00518.29
8.4.40.0100.00418.23
8.4.30.0120.00618.10
8.4.20.0150.00618.16
8.4.10.0070.00517.98
8.3.330.0080.00418.84
8.3.320.0120.00718.86
8.3.310.0120.00518.81
8.3.300.0120.01018.73
8.3.290.0160.00818.73
8.3.280.0110.01118.80
8.3.270.0120.00616.95
8.3.260.0130.00416.94
8.3.250.0080.01117.15
8.3.240.0070.00517.02
8.3.230.0160.00516.94
8.3.220.0080.00916.91
8.3.210.0070.00316.90
8.3.200.0080.00116.94
8.3.190.0060.00317.00
8.3.180.0030.00616.86
8.3.170.0080.00216.94
8.3.160.0070.01317.17
8.3.150.0110.00817.02
8.3.140.0120.00717.06
8.3.130.0060.00717.05
8.3.120.0120.00817.26
8.3.110.0110.00917.05
8.3.100.0130.00717.13
8.3.90.0050.00716.93
8.3.80.0090.00317.05
8.3.70.0140.00616.96
8.3.60.0100.00917.06
8.3.50.0150.00417.10
8.3.40.0060.00818.39
8.3.30.0060.00718.11
8.3.20.0110.00218.35
8.3.10.0030.00718.30
8.3.00.0150.00518.33
8.2.330.0120.00418.13
8.2.320.0120.00618.39
8.2.310.0080.00218.34

preferences:
49.2 ms | 789 KiB | 5 Q