3v4l.org

run code in 500+ PHP versions simultaneously
<?php function lookAndSay(int $n): string { if ($n <= 1) return '1'; $r = $lastSeq = '1'; while($n-- > 0) $r .= ' '.($lastSeq = tokenize($lastSeq)); return $r; } function tokenize(string $str): string { $r = ''; $c = 1; for ($i = 0; $i < strlen($str); $i++) { if($str[$i] == ($str[$i + 1] ?? '')) { $c++; continue; } ($r .= $c.$str[$i]) && ($c = 1); } return $r; } echo lookAndSay(3);

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.70.0120.00616.89
8.5.60.0110.00716.98
8.5.50.0080.00718.52
8.5.30.0150.00619.24
8.5.20.0130.00719.70
8.5.10.0110.00721.92
8.5.00.0110.01020.00
8.4.210.0140.00719.57
8.4.180.0090.01219.54
8.4.170.0100.01123.89
8.4.160.0140.00922.14
8.4.150.0080.00416.87
8.4.140.0150.00617.47
8.4.130.0030.00618.85
8.4.120.0110.00920.81
8.4.110.0070.01519.57
8.4.100.0110.00917.71
8.4.90.0050.00420.38
8.4.80.0060.00318.98
8.4.70.0060.00318.95
8.4.60.0110.00718.79
8.4.50.0120.00720.33
8.4.40.0100.00719.54
8.4.30.0030.00918.83
8.4.20.0080.00417.74
8.4.10.0100.00622.01
8.3.300.0180.00918.45
8.3.290.0140.01120.88
8.3.280.0120.00818.42
8.3.270.0130.00816.48
8.3.260.0080.01116.50
8.3.250.0150.00416.55
8.3.240.0040.00418.16
8.3.230.0090.01016.57
8.3.220.0120.00519.23
8.3.210.0110.00816.75
8.3.200.0060.00416.82
8.3.190.0060.00217.47
8.3.180.0080.01017.19
8.3.170.0070.01019.09
8.3.160.0080.01117.27
8.3.150.0140.00317.14
8.3.140.0100.00017.22
8.3.130.0000.00818.28
8.3.120.0070.01020.95
8.3.110.0090.00020.94
8.3.100.0030.00724.06
8.3.90.0040.00426.77
8.3.80.0060.00316.63
8.3.70.0130.00716.63
8.3.60.0070.00718.43
8.3.50.0100.00318.29
8.3.40.0040.01120.09
8.3.30.0040.01118.88
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0110.00026.16
8.2.300.0130.00622.34
8.2.290.0080.01116.55
8.2.280.0090.00918.17
8.2.270.0000.01917.19
8.2.260.0090.00916.50
8.2.250.0090.01216.42
8.2.240.0060.00317.29
8.2.230.0000.00722.58
8.2.220.0030.00737.54
8.2.210.0100.00526.77
8.2.200.0090.00016.88
8.2.190.0070.00716.58
8.2.180.0180.00425.92
8.2.170.0120.00319.04
8.2.160.0100.00322.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00021.09
8.2.110.0090.00020.47
8.2.100.0070.00320.52
8.1.340.0100.00923.83
8.1.330.0150.00416.02
8.1.320.0130.00616.43
8.1.310.0030.01418.31
8.1.300.0130.00317.86
8.1.290.0030.00730.84
8.1.280.0180.00325.92
8.1.270.0060.00324.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0080.00418.62
8.1.230.0100.00018.59
7.4.300.0070.00316.46

preferences:
65.73 ms | 861 KiB | 5 Q