3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 0 => 'ACHNANTHES Bory, Dict. Class. Hist. Nat. 1: 79 (1822). / SUCINCIĞI.', 1 => 'A. brevipes C.Agardh, Syst. Alg.: 1 (1824). / Küçük sucıncığı.', 2 => 'A. coarctata (Bréb. ex W.Sm.) Grunow, Syn. Diat. Belg.: expl. pl. XXVI: ş. 17 (1880). / Dar sucıncığı.', 3 => 'A. cocconeiformis Mann, U.S. Nat. Mus., Bull. 6: 182 (1925). / Top sucıncığı.', 4 => 'A. gibberula Grunow, Kongl. Svenska Vetensk.-Akad. Handl. 17(2): 121 (1880). / Kambur sucıncığı.', 5 => 'A. lacunarum Hust., Bacillariophyta (Diatomeae) Zweite Auflage, Süsswass.-Fl. Mitteleurop. 10: 205 (1930). / Delikli sucıncığı.', 6 => 'A. lineariformis Lange-Bert., Biblioth. Diatomol. 27: 7, 134 pl. (1993). / Düz sucıncığı.', 7 => 'A. longipes C.Agardh, Syst. Alg.: 1 (1824). / Boylu sucıncığı.', 8 => 'A. nollii Bock, Nachrichtendes Naturwiss. Museums Stadt Aschaffenburg 38: 1 (1953). / Yaban sucıncığı.', 9 => 'A. parvula Kütz., Bacillarien: 76, pl. 21: ş. 5 (1844). / Saf sucıncığı.', 10 => 'A. petersenii Hust., Rabenhorst’s Krypt.-Fl. Deutschl.: 179, ş 10-14 (1937). / Bal sucıncığı.', 11 => 'A. pyrenaicum (Hust.) H.Kobayasi, Nova Hedwigia 65(1-4): 148, ş. 1-18 (1997). / Garip sucıncığı.', 12 => 'A. stolida (Krasske) Krasske, Ann. Acad. Sc. Fenn., ser. A, Biol. 14: 78 (1949). / Alık sucıncığı.', 13 => 'A. thermalis (Rabenh.) Schoenfeld, Diat. German.: 122 (1907). / Sıcak sucıncığı.', 14 => 'A. trinodis (Ralfs) Grunow, Syn. Diatom. Belg.: pl. XXVII: ş. 50 (1880). / Üç sucıncığı.', 15 => 'A. wellsiae Reimer, Monogr. Acad. Nat. Sci. Philadelphia 1: 16 (1966). / El sucıncığı.', 16 => 'PLATESSA Lange-Bert., Süsswass.-Fl. Mitteleuropa 2: 443 (2004). / SUTANESİ.', 17 => 'P. conspicua (Ant.Mayer) Lange-Bert., Süsswass.-Fl. Mitteleuropa 2: 445 (2004). / Küt sutanesi.', 18 => 'P. montana (Krasske) Lange-Bert., Süsswass.-Fl. Mitteleuropa 2: 445 (2004). / Dağ sutanesi.', 19 => 'P. salinarum (Grunow) Lange-Bert. / Sutanesi.', 20 => 'ACHNANTHIDIUM Kütz., Bacillarien: 75 (1844). / SUÇUBUĞU.', 21 => 'A. affine (Grunow) Czarn., Mem. Calif. Acad. Sci. 17: 156 (1994). / Hoş suçubuğu.', 22 => 'A. deflexum Kingston, Diatom Res. 15(2): 409 (2000). / Kıvrık suçubuğu.', 23 => 'A. exiguum (Grunow) Czarnecki, Mem. Calif. Acad. Sci. 17: 155 (1994). / Delikli suçubuğu.', 24 => 'A. exile (Kütz.) Heiberg, Conspect. Diatom. Dan.: 119 (1863). / Bitik suçubuğu.', 25 => 'A. lanceolatum (Bréb.) Kütz., Bot. Zeitung 4(14): 247 (1846). / Uzun suçubuğu.', 26 => 'A. minutissimum (Kütz.) Czarn., Mem. Calif. Acad. Sci. 17: 155 (1994). / Cüce suçubuğu.', 27 => 'A. minutum Cleve, Fl. Fenn. 8(2): 1 (1891). / Bodur suçubuğu.', 28 => 'A. thermale Rabenh., Fl. Eur. Alg. 1: 107 (1864). / Sıcak suçubuğu.', 29 => 'EUCOCCONEIS Cleve ex Meister, Beitr. Kryptogamenfl. Schweiz IV(1): 95 (1912). / SUESNEĞİ.', 30 => 'E. flexella (Kütz.) Meister, Beitr. Kryptogamenfl. Schweiz IV(1): 95 (1912). / Suesneği.', 31 => 'E. laevis (Østrup) Lange-Bert., Iconogr. Diatomol. 6: 46 (1999). / Pek suesneği.', 32 => 'E. quadratarea (Østrup) Lange-Bert., Iconogr. Diatomol. 6: 48 (1999). / Dört suesneği.', ]; $result = []; $currentGenus = null; foreach ($array as $line) { $firstWord = strstr($line, ' ', true); if (ctype_upper($firstWord)) { $currentGenus = $firstWord; $result[] = $firstWord; } else { $result[] = ucfirst(strtolower($currentGenus)) . ' ' . explode(' ', $line, 3)[1]; } } var_export($result);

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.00.0150.00819.75
8.4.150.0020.00014.05
8.4.140.0140.00817.48
8.4.130.0120.00917.64
8.4.120.0080.01120.63
8.4.110.0120.00520.61
8.4.100.0130.00318.64
8.4.90.0080.00518.88
8.4.80.0060.00417.68
8.4.70.0140.00717.64
8.4.60.0140.00718.91
8.4.50.0120.00818.78
8.4.40.0100.00717.66
8.4.30.0130.00620.60
8.4.20.0090.01217.78
8.4.10.0080.00019.66
8.3.280.0120.00818.54
8.3.270.0140.00616.63
8.3.260.0100.00916.79
8.3.250.0140.00519.06
8.3.240.0120.00518.34
8.3.230.0100.01016.86
8.3.220.0100.00218.90
8.3.210.0050.01318.32
8.3.200.0040.00416.73
8.3.190.0070.00717.14
8.3.180.0130.00616.86
8.3.170.0110.00718.82
8.3.160.0030.01317.14
8.3.150.0040.01417.34
8.3.140.0050.00318.41
8.3.130.0080.00018.37
8.3.120.0060.00318.80
8.3.110.0030.00620.94
8.3.100.0030.00618.43
8.3.90.0150.00318.31
8.3.80.0080.00317.97
8.3.70.0130.00916.50
8.3.60.0150.00616.63
8.3.50.0080.01024.41
8.3.40.0110.01119.08
8.3.30.0070.01018.64
8.3.20.0000.00721.95
8.3.10.0080.00022.02
8.3.00.0070.00023.66
8.2.290.0110.00720.43
8.2.280.0140.00520.01
8.2.270.0070.01118.78
8.2.260.0000.00820.70
8.2.250.0000.00918.33
8.2.240.0070.00317.13
8.2.230.0030.00622.58
8.2.220.0080.00624.06
8.2.210.0000.00826.77
8.2.200.0060.00318.50
8.2.190.0150.00016.84
8.2.180.0060.01118.41
8.2.170.0120.00322.96
8.2.160.0130.00319.13
8.2.150.0000.00824.18
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0070.00021.03
8.2.110.0070.00322.11
8.2.100.0040.00817.84
8.2.90.0070.00020.59
8.2.80.0060.00317.97
8.2.70.0040.00418.15
8.2.60.0000.00818.16
8.2.50.0060.00318.07
8.2.40.0080.00018.28
8.2.30.0030.00518.22
8.2.20.0050.00218.16
8.2.10.0000.00719.20
8.2.00.0000.00719.43
8.1.330.0140.00721.96
8.1.320.0110.00815.75
8.1.310.0030.00616.87
8.1.300.0070.00718.17
8.1.290.0050.00518.88
8.1.280.0040.01425.92
8.1.270.0040.00422.05
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00722.61
8.1.230.0110.00020.91
8.1.220.0030.00517.76
8.1.210.0040.00419.00
8.1.200.0050.00317.35
8.1.190.0040.00417.35
8.1.180.0060.00319.31
8.1.170.0030.00518.55
8.1.160.0030.00618.97
8.1.150.0040.00418.88
8.1.140.0000.00818.97
8.1.130.0060.00320.16
8.1.120.0000.01017.47
8.1.110.0100.00017.41
8.1.100.0000.00717.54
8.1.90.0040.00417.49
8.1.80.0040.00417.45
8.1.70.0000.00817.52
8.1.60.0040.00417.57
8.1.50.0050.00317.45
8.1.40.0030.00517.54
8.1.30.0090.00317.73
8.1.20.0060.00317.64
8.1.10.0000.00917.56
8.1.00.0050.00317.49
8.0.300.0100.00019.89
8.0.290.0040.00416.75
8.0.280.0000.00718.55
8.0.270.0000.00718.03
8.0.260.0080.00021.77
8.0.250.0030.00317.02
8.0.240.0040.00417.01
8.0.230.0030.00416.89
8.0.220.0070.00016.92
8.0.210.0000.00716.86
8.0.200.0000.00716.94
8.0.190.0000.00916.98
8.0.180.0070.00016.96
8.0.170.0050.00316.91
8.0.160.0030.00616.98
8.0.150.0050.00216.76
8.0.140.0070.00016.86
8.0.130.0000.00513.39
8.0.120.0050.00216.79
8.0.110.0040.00416.98
8.0.100.0000.00816.95
8.0.90.0090.00016.80
8.0.80.0090.00816.92
8.0.70.0040.00416.80
8.0.60.0040.00416.71
8.0.50.0040.00416.80
8.0.30.0060.01216.91
8.0.20.0080.01117.12
8.0.10.0040.00416.98
8.0.00.0100.01416.93
7.4.330.0000.00415.55
7.4.320.0040.00416.50
7.4.300.0000.00816.54
7.4.290.0030.00316.63
7.4.280.0070.00016.63
7.4.270.0000.00816.46
7.4.260.0060.00013.33
7.4.250.0080.00016.36
7.4.240.0000.00816.50
7.4.230.0000.00816.71
7.4.220.0020.00516.65
7.4.210.0080.00816.63
7.4.200.0000.00716.66
7.4.130.0170.00316.49
7.4.120.0040.01916.54
7.4.110.0310.02116.50
7.4.100.0100.00616.72
7.4.90.0140.00316.31
7.4.80.0070.01019.39
7.4.70.0080.00816.42
7.4.60.0100.00716.61
7.4.50.0100.00316.57
7.4.40.0100.01016.44
7.4.30.0040.01916.24
7.4.20.0300.01816.60
7.4.10.0170.00816.49
7.4.00.0110.00716.56
7.3.330.0000.00716.50
7.3.320.0000.00513.27
7.3.310.0000.00716.23
7.3.300.0030.00316.39
7.3.290.0100.00716.43
7.3.280.0070.00716.30
7.3.260.0130.00416.42
7.3.240.0080.00816.50
7.3.230.0060.01016.52
7.3.210.0040.01116.54
7.3.200.0060.00916.39
7.3.190.0110.00516.62
7.3.180.0120.01116.40
7.3.170.0070.01016.55
7.3.160.0250.01416.30
7.3.150.0200.00516.69
7.3.140.0130.01316.21
7.3.130.0210.00616.67
7.3.120.0130.00916.46
7.3.110.0160.00616.31
7.3.100.0090.00916.22
7.3.90.0100.01016.34
7.3.80.0090.00916.52
7.3.70.0140.01016.28
7.3.60.0130.00716.50
7.3.50.0080.01316.35
7.3.40.0090.01016.24
7.3.30.0110.00716.27
7.3.20.0140.00716.57
7.3.10.0080.01416.12
7.3.00.0140.00616.23
7.2.330.0110.00716.62
7.2.320.0060.01316.46
7.2.310.0000.01616.60
7.2.300.0030.01516.53
7.2.290.0190.00716.42
7.2.280.0090.01516.72
7.2.270.0030.02116.56
7.2.260.0190.00316.59
7.2.250.0120.01316.64
7.2.240.0100.01016.64
7.2.230.0150.00616.62
7.2.220.0120.01016.46
7.2.210.0100.01016.71
7.2.200.0060.01716.36
7.2.190.0040.01616.49
7.2.180.0060.01616.45
7.2.170.0130.00816.57
7.2.160.0120.01216.29
7.2.150.0160.00416.85
7.2.140.0210.00716.44
7.2.130.0100.01316.56
7.2.120.0090.01516.53
7.2.110.0090.01416.61
7.2.100.0100.01316.49
7.2.90.0170.00716.52
7.2.80.0220.00616.58
7.2.70.0210.00816.53
7.2.60.0160.01516.48
7.2.50.0180.01116.39
7.2.40.0140.01116.56
7.2.30.0230.00416.61
7.2.20.0150.01316.53
7.2.10.0170.00816.44
7.2.00.0090.01516.61

preferences:
31.47 ms | 403 KiB | 5 Q