3v4l.org

run code in 300+ PHP versions simultaneously
<?php function normaliza ($string){ $a = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿ'; $b = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyyby'; $string = utf8_decode($string); $string = strtr($string, utf8_decode($a), $b); $string = strtolower($string); return utf8_encode($string); } function parseStopWords($text){ $tex = normaliza($text); $text = str_replace('¡¿?!', '', $text); $text = preg_replace('/[^a-zA-Z0-9\', ]/i','',$text); $stopwords = array('ante','bajo','cabe','con','contra','de','desde','en','entre','hacia','hasta','para','por','sin','sobre','tras','el','lo','la','los','las','un','unos','una','al','del','que','es','se','y','fue'); foreach($stopwords as $w){ $text = preg_replace('/\b'.$w.'\b/i','',$text); } $text = preg_replace('/\s{2,}/i',' ',$text); $text = str_replace(" a ", "", $text); return $text; } echo parseStopWords('¿Qué ha sido de nuestra niñez?');

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.00018.68
8.3.50.0130.01121.33
8.3.40.0060.00918.92
8.3.30.0140.00020.17
8.3.20.0060.00318.79
8.3.10.0060.00321.09
8.3.00.0060.00323.61
8.2.180.0070.01116.88
8.2.170.0040.01122.96
8.2.160.0060.01020.55
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.95
8.2.110.0090.00319.32
8.2.100.0060.00618.16
8.2.90.0000.00819.29
8.2.80.0080.00019.34
8.2.70.0060.00318.13
8.2.60.0050.00318.05
8.2.50.0090.00018.07
8.2.40.0040.00420.20
8.2.30.0000.00819.50
8.2.20.0000.00817.93
8.2.10.0000.00817.93
8.2.00.0040.00417.93
8.1.270.0000.00823.99
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00322.52
8.1.230.0120.00021.00
8.1.220.0050.00318.77
8.1.210.0030.00819.04
8.1.200.0090.00417.47
8.1.190.0040.00417.65
8.1.180.0040.00418.10
8.1.170.0040.00418.84
8.1.160.0030.00518.89
8.1.150.0030.00718.84
8.1.140.0050.00217.71
8.1.130.0040.00417.85
8.1.120.0040.00417.74
8.1.110.0060.00317.66
8.1.100.0080.00017.64
8.1.90.0040.00417.71
8.1.80.0040.00417.69
8.1.70.0040.00417.64
8.1.60.0040.00717.75
8.1.50.0030.00517.66
8.1.40.0030.00517.73
8.1.30.0040.00417.89
8.1.20.0000.00817.84
8.1.10.0060.00317.79
8.1.00.0040.00417.68
8.0.300.0000.00820.19
8.0.290.0050.00217.29
8.0.280.0020.00518.54
8.0.270.0000.00717.37
8.0.260.0070.00016.92
8.0.250.0050.00317.10
8.0.240.0090.00017.24
8.0.230.0000.00817.07
8.0.220.0030.00517.00
8.0.210.0030.00517.15
8.0.200.0000.00717.17
8.0.190.0070.00417.19
8.0.180.0060.00317.07
8.0.170.0040.00417.03
8.0.160.0040.00417.19
8.0.150.0040.00417.10
8.0.140.0030.00717.14
8.0.130.0060.00013.58
8.0.120.0040.00417.06
8.0.110.0040.00417.03
8.0.100.0040.00417.18
8.0.90.0000.00717.15
8.0.80.0060.01317.18
8.0.70.0040.00417.17
8.0.60.0080.00017.00
8.0.50.0000.00917.13
8.0.30.0110.01217.42
8.0.20.0120.00717.40
8.0.10.0030.00517.20
8.0.00.0080.01416.85
7.4.330.0060.00016.72
7.4.320.0060.00016.80
7.4.300.0000.00716.91
7.4.290.0030.00316.68
7.4.280.0000.00716.78
7.4.270.0000.00816.80
7.4.260.0030.00613.55
7.4.250.0040.00416.85
7.4.240.0020.00516.78
7.4.230.0040.00416.96
7.4.220.0160.00316.82
7.4.210.0100.00716.84
7.4.200.0080.00017.00
7.4.190.0050.00316.61
7.4.160.0130.00316.69
7.4.150.0180.00017.40
7.4.140.0160.00517.86
7.4.130.0090.01016.72
7.4.120.0090.00916.77
7.4.110.0090.00916.84
7.4.100.0140.00316.96
7.4.90.0040.01516.84
7.4.80.0110.00819.39
7.4.70.0120.00616.68
7.4.60.0090.01416.71
7.4.50.0000.00516.60
7.4.40.0080.00822.77
7.4.30.0070.01116.75
7.4.00.0090.00615.36
7.3.330.0050.00013.28
7.3.320.0000.00513.38
7.3.310.0030.00416.55
7.3.300.0000.00716.57
7.3.290.0040.01216.50
7.3.280.0060.01016.52
7.3.270.0120.01217.40
7.3.260.0070.01418.24
7.3.250.0070.01116.65
7.3.240.0120.00916.84
7.3.230.0170.00716.71
7.3.210.0060.01216.68
7.3.200.0060.01319.39
7.3.190.0170.00716.95
7.3.180.0100.00716.81
7.3.170.0130.01016.89
7.3.160.0140.00316.77
7.3.120.0080.00615.40
7.2.330.0090.01017.08
7.2.320.0180.00016.93
7.2.310.0130.01017.00
7.2.300.0070.01016.95
7.2.290.0030.01916.83
7.2.60.0030.01017.29
7.2.00.0070.00719.86
7.1.200.0030.01215.95
7.1.100.0030.01418.34
7.1.70.0030.00617.44
7.1.60.0070.01819.17
7.1.50.0000.01917.21
7.1.00.0000.05722.30
7.0.200.0030.00517.06
7.0.140.0070.07022.04
7.0.60.0100.08321.87
7.0.50.0030.04317.95
7.0.40.0100.04720.33
7.0.30.0300.07720.27
7.0.20.0200.08720.09
7.0.10.0070.05020.13
7.0.00.0070.07320.27
5.6.280.0030.07320.91
5.6.210.0070.07720.62
5.6.200.0030.04318.19
5.6.190.0030.08020.50
5.6.180.0330.04020.41
5.6.170.0200.04320.58
5.6.160.0100.04020.44
5.6.150.0100.08018.13
5.6.140.0100.07718.18
5.6.130.0000.07718.25
5.6.120.0000.04721.00
5.6.110.0100.06021.13
5.6.100.0100.07721.15
5.6.90.0030.05721.02
5.6.80.0030.07320.50
5.5.350.4070.04320.42
5.5.340.0100.07717.96
5.5.330.0130.04720.41
5.5.320.0200.05320.30
5.5.310.0200.05320.27
5.5.300.0030.05018.09
5.5.290.0030.09018.02
5.5.280.0070.08720.75
5.5.270.0030.08020.77
5.5.260.0070.05020.91
5.5.250.0070.06720.71
5.5.240.0200.04720.29
5.4.450.0330.05319.53
5.4.440.0270.04019.30
5.4.430.0230.04319.52
5.4.420.0400.07019.36
5.4.410.0370.07019.43
5.4.400.0330.06019.00
5.4.390.0530.05319.11
5.4.380.0470.06718.94
5.4.370.0430.06719.20
5.4.360.0470.06019.05
5.4.350.0400.06719.16
5.4.340.0430.07019.01
5.4.320.0430.04318.95
5.4.310.0370.06719.20
5.4.300.0300.04019.22
5.4.290.0300.07319.23
5.4.280.0330.04719.20
5.4.270.0430.06319.13
5.4.260.0400.04019.23
5.4.250.0300.05019.06
5.4.240.0300.03719.13
5.4.230.0330.03019.20
5.4.220.0370.04719.25
5.4.210.0370.06719.13
5.4.200.0330.04719.06
5.4.190.0270.05719.03
5.4.180.0300.07019.14
5.4.170.0270.04019.13
5.4.160.0300.04719.21
5.4.150.0270.03719.11
5.4.140.0330.07316.36
5.4.130.0370.05016.52
5.4.120.0330.06716.42
5.4.110.0330.04316.48
5.4.100.0330.05716.24
5.4.90.0370.06316.53
5.4.80.0300.05316.46
5.4.70.0330.06716.32
5.4.60.0400.06316.55
5.4.50.0300.03016.43
5.4.40.0370.04716.41
5.4.30.0330.04316.38
5.4.20.0430.03716.50
5.4.10.0330.06316.33
5.4.00.0430.04315.71
5.3.290.0300.05314.58
5.3.280.0270.06714.64
5.3.270.0330.04314.64
5.3.260.0330.06714.64
5.3.250.0330.07314.67
5.3.240.0400.06014.63
5.3.230.0370.06314.64
5.3.220.0200.05314.57
5.3.210.0230.04014.74
5.3.200.0270.03714.63
5.3.190.0330.06714.60
5.3.180.0300.04714.61
5.3.170.0330.04314.64
5.3.160.0270.03714.64
5.3.150.0370.04714.50
5.3.140.0400.06314.72
5.3.130.0370.05314.64
5.3.120.0330.05314.62
5.3.110.0270.05014.57
5.3.100.0500.05714.09
5.3.90.0430.07014.04
5.3.80.0470.06014.05
5.3.70.0330.06314.10
5.3.60.0470.05714.07
5.3.50.0400.03713.97
5.3.40.0300.04713.89
5.3.30.0470.05313.86
5.3.20.0470.06313.76
5.3.10.0470.06313.75
5.3.00.0330.05713.70
5.2.170.0300.06311.18
5.2.160.0330.05711.17
5.2.150.0270.03011.32
5.2.140.0270.02711.11
5.2.130.0370.05311.07
5.2.120.0270.03011.01
5.2.110.0400.04311.12
5.2.100.0370.05711.27
5.2.90.0430.04011.08
5.2.80.0270.04711.20
5.2.70.0300.05011.11
5.2.60.0330.04710.99
5.2.50.0300.04011.00
5.2.40.0230.05311.09
5.2.30.0270.03711.16
5.2.20.0400.02310.94
5.2.10.0230.05010.77
5.2.00.0170.03310.75
5.1.60.0230.04310.07
5.1.50.0200.02310.06
5.1.40.0300.04310.15
5.1.30.0300.05010.37
5.1.20.0230.03310.33
5.1.10.0270.02310.05
5.1.00.0270.05310.14
5.0.50.0130.0438.65
5.0.40.0170.0278.46
5.0.30.0130.0578.22
5.0.20.0130.0408.28
5.0.10.0100.0338.26
5.0.00.0130.0338.17
4.4.90.0130.0237.47
4.4.80.0230.0277.47
4.4.70.0130.0207.47
4.4.60.0130.0377.47
4.4.50.0170.0177.47
4.4.40.0270.0407.47
4.4.30.0130.0337.47
4.4.20.0130.0337.47
4.4.10.0170.0377.47
4.4.00.0070.0337.47
4.3.110.0130.0377.47
4.3.100.0170.0337.47
4.3.90.0130.0307.47
4.3.80.0070.0307.47
4.3.70.0070.0237.47
4.3.60.0070.0207.47
4.3.50.0100.0237.47
4.3.40.0130.0437.47
4.3.30.0100.0237.47
4.3.20.0100.0177.47
4.3.10.0030.0237.47
4.3.00.0070.0337.47

preferences:
60.21 ms | 400 KiB | 5 Q