3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!function_exists(cutstringgf)) { function cutstringgf($stranb, $lengthanb, $theend = "... ") { $stranb = strip_tags($stranb); if (strlen($stranb) > 80) { $text2 = substr($stranb, 0, $lengthanb); $words = explode(" ", $text2); $words = array_reverse($words); array_splice($words, 0, 1); $alexxnb = 0; for ($i = 0; $i < count($words); $i++) { $i = $i - $alexxnb; if (substr($words[$i], - 1) == "," or substr($words[$i], - 1) == "." or substr($words[$i], - 1) == ":" or substr($words[$i], - 1) == ";") { $words[$i] = substr($words[$i], 0, strlen($words[$i]) - 1); } ; $wrd = $words[$i]; if (strlen($wrd) < 4) { array_splice($words, $i, 1); $alexxnb = 1; } else { $i = 1985; } ; } ; $mwords = ""; $words = array_reverse($words); for ($i = 0; $i < count($words); $i++) { $mwords = $mwords . $words[$i]; if ($i != count($words) - 1) { $mwords = $mwords . " "; } else { $mwords = $mwords . $theend; } ; } ; } else { $mwords = $stranb; } echo $mwords; } } $txt = $modx->getDocument($iddoc); $source = '<p>Seth Kimbrough стал совсем модненьким, знатоки помнят с каких "диванов" он начинал. Приятно смотреть на его катание в любом обличии. Катается не в напряг и это чувствуется после просмотра любого видео. Эта реклама <a title="shadow" href="brands/shadow_conspiracy_bmx.html" target="_blank">Shadow</a> - не исключение. Здорово!</p> <p>&nbsp;</p>'; echo cutstringgf(stripslashes(preg_replace("/<img(.*?)\>/", "", preg_replace('/<span[^>]*>(.*)<\/span>/Ui', '\\1', $source))), 350); ?>

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.0110.00418.56
8.3.50.0100.00921.94
8.3.40.0100.01018.79
8.3.30.0110.00419.06
8.3.20.0050.00220.30
8.3.10.0000.00823.52
8.3.00.0040.00419.51
8.2.180.0150.00016.35
8.2.170.0110.00422.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0050.00226.16
8.2.120.0050.00322.24
8.2.110.0070.00321.11
8.2.100.0000.01117.72
8.2.90.0030.00618.03
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0060.00317.93
8.2.50.0000.00818.07
8.2.40.0060.00320.05
8.2.30.0000.00717.96
8.2.20.0060.00317.73
8.2.10.0070.00018.13
8.2.00.0000.00817.90
8.1.280.0070.01125.92
8.1.270.0080.00023.88
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00422.51
8.1.230.0080.00420.97
8.1.220.0060.00317.78
8.1.210.0000.01118.90
8.1.200.0100.00017.25
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0050.00518.67
8.1.160.0030.00522.07
8.1.150.0040.00418.85
8.1.140.0000.00817.29
8.1.130.0000.00717.70
8.1.120.0000.00717.34
8.1.110.0000.00817.43
8.1.100.0040.00417.41
8.1.90.0030.00317.45
8.1.80.0030.00317.38
8.1.70.0030.00317.33
8.1.60.0060.00317.57
8.1.50.0030.00517.38
8.1.40.0040.00417.41
8.1.30.0000.00817.64
8.1.20.0000.00817.59
8.1.10.0000.00717.52
8.1.00.0000.00717.46
8.0.300.0040.00419.95
8.0.290.0040.00416.75
8.0.280.0000.00718.43
8.0.270.0030.00317.30
8.0.260.0000.00717.21
8.0.250.0030.00516.95
8.0.240.0050.00216.98
8.0.230.0050.00217.06
8.0.220.0040.00416.82
8.0.210.0000.00716.87
8.0.200.0050.00316.94
8.0.190.0040.00417.02
8.0.180.0030.00516.92
8.0.170.0060.00316.90
8.0.160.0000.00716.89
8.0.150.0080.00016.89
8.0.140.0030.00516.95
8.0.130.0030.00313.48
8.0.120.0000.00816.97
8.0.110.0040.00416.95
8.0.100.0000.00716.77
8.0.90.0040.00416.82
8.0.80.0110.01117.05
8.0.70.0040.00417.01
8.0.60.0040.00417.04
8.0.50.0000.00817.07
8.0.30.0150.00617.11
8.0.20.0140.00517.40
8.0.10.0000.00716.83
8.0.00.0130.00816.79
7.4.330.0060.00015.00
7.4.320.0060.00016.47
7.4.300.0050.00216.50
7.4.290.0070.00016.46
7.4.280.0050.00316.56
7.4.270.0000.00716.45
7.4.260.0000.00716.45
7.4.250.0000.00816.45
7.4.240.0000.00716.48
7.4.230.0000.00716.55
7.4.220.0040.01416.51
7.4.210.0070.00916.50
7.4.200.0060.00316.60
7.4.160.0060.00916.39
7.4.150.0090.00917.40
7.4.140.0120.00517.86
7.4.130.0120.00616.56
7.4.120.0110.00716.63
7.4.110.0100.01016.61
7.4.100.0100.00716.38
7.4.90.0130.00316.63
7.4.80.0000.01619.39
7.4.70.0130.00316.60
7.4.60.0100.00716.52
7.4.50.0050.00316.55
7.4.40.0070.01416.48
7.4.30.0140.00316.45
7.4.00.0060.00915.24
7.3.330.0030.00313.27
7.3.320.0030.00313.27
7.3.310.0040.00416.23
7.3.300.0030.00316.34
7.3.290.0070.01516.36
7.3.280.0120.00516.31
7.3.270.0160.00617.40
7.3.260.0130.01016.43
7.3.250.0120.00516.38
7.3.240.0130.01016.56
7.3.230.0140.00316.50
7.3.210.0100.00716.39
7.3.200.0130.00719.39
7.3.190.0060.01116.47
7.3.180.0030.01316.50
7.3.170.0040.01216.35
7.3.160.0090.00616.57
7.2.330.0120.01116.79
7.2.320.0030.02316.55
7.2.310.0060.01516.46
7.2.300.0170.00016.85
7.2.290.0170.00716.45
7.2.60.0070.00716.88
7.2.00.0000.01219.07
7.1.200.0050.00615.86
7.1.100.0080.00418.24
7.1.70.0000.00716.95
7.1.60.0100.01419.32
7.1.50.0170.00716.92
7.1.00.0100.07022.30
7.0.200.0000.00916.41
7.0.140.0000.07721.97
7.0.60.0000.05319.95
7.0.50.0130.05317.89
7.0.40.0070.08720.23
7.0.30.0170.05320.16
7.0.20.0270.04320.10
7.0.10.0100.04020.09
7.0.00.0000.04320.06
5.6.280.0030.07321.17
5.6.210.0000.06720.77
5.6.200.0100.07318.27
5.6.190.0070.05020.50
5.6.180.0200.05320.68
5.6.170.0230.05720.56
5.6.160.0100.08020.50
5.6.150.0070.08318.20
5.6.140.0000.08718.19
5.6.130.0070.04018.24
5.6.120.0100.04720.87
5.6.110.0130.07321.16
5.6.100.0070.08021.13
5.6.90.0130.03721.01
5.6.80.0130.04320.43
5.5.350.0230.06020.43
5.5.340.0030.04017.99
5.5.330.0070.07020.27
5.5.320.0370.05020.38
5.5.310.0230.08320.20
5.5.300.0030.05017.93
5.5.290.0100.08317.98
5.5.280.0130.05020.79
5.5.270.0030.06020.68
5.5.260.0070.05720.66
5.5.250.0030.06020.70
5.5.240.0070.04020.25
5.4.450.0200.06319.60
5.4.440.0130.06719.62
5.4.430.0300.06019.30
5.4.420.0630.00019.32
5.4.410.0630.00019.32
5.4.400.0630.00019.21
5.4.390.0600.00019.13
5.4.380.0670.00019.13
5.4.370.0630.00019.13
5.4.360.0600.00019.24
5.4.350.0670.00019.04
5.4.340.0070.03512.03
5.4.320.0050.03812.52
5.4.310.0080.03712.52
5.4.300.0080.03412.52
5.4.290.0060.03712.51
5.4.280.0080.03212.41
5.4.270.0040.04112.41
5.4.260.0050.03812.41
5.4.250.0070.03612.41
5.4.240.0070.04312.41
5.4.230.0100.04912.40
5.4.220.0120.04312.40
5.4.210.0080.03712.40
5.4.200.0110.03612.41
5.4.190.0040.03712.40
5.4.180.0020.03912.40
5.4.170.0050.03712.41
5.4.160.0040.03812.41
5.4.150.0050.03712.40
5.4.140.0080.03612.09
5.4.130.0050.03812.07
5.4.120.0060.03412.03
5.4.110.0050.03512.03
5.4.100.0080.03212.02
5.4.90.0050.04012.02
5.4.80.0040.03812.03
5.4.70.0050.03612.03
5.4.60.0080.03212.02
5.4.50.0080.03312.03
5.4.40.0050.03412.01
5.4.30.0060.03412.01
5.4.20.0040.03612.00
5.4.10.0080.03212.01
5.4.00.0040.03611.50
5.3.290.0100.03912.80
5.3.280.0070.03612.71
5.3.270.0070.03712.72
5.3.260.0050.04012.72
5.3.250.0050.03812.72
5.3.240.0060.03712.72
5.3.230.0060.03812.71
5.3.220.0060.03712.68
5.3.210.0060.03812.68
5.3.200.0050.03612.68
5.3.190.0060.03612.68
5.3.180.0070.03512.67
5.3.170.0110.03112.67
5.3.160.0060.03612.68
5.3.150.0070.03512.68
5.3.140.0050.04112.66
5.3.130.0080.03912.66
5.3.120.0060.03912.66
5.3.110.0100.04012.66
5.3.100.0060.03712.14
5.3.90.0050.04012.12
5.3.80.0060.03812.11
5.3.70.0040.03912.11
5.3.60.0070.03512.10
5.3.50.0070.04312.04
5.3.40.0080.03612.04
5.3.30.0100.03112.01
5.3.20.0050.03611.78
5.3.10.0050.04211.75
5.3.00.0080.03511.73
5.2.170.0050.0309.24
5.2.160.0060.0289.25
5.2.150.0060.0309.24
5.2.140.0060.0309.24
5.2.130.0060.0279.20
5.2.120.0070.0269.20
5.2.110.0020.0329.21
5.2.100.0040.0349.20
5.2.90.0040.0309.20
5.2.80.0060.0289.20
5.2.70.0050.0309.20
5.2.60.0030.0349.15
5.2.50.0060.0299.12
5.2.40.0040.0309.09
5.2.30.0090.0269.07
5.2.20.0070.0269.06
5.2.10.0060.0278.96
5.2.00.0050.0298.84
5.1.60.0020.0288.11
5.1.50.0040.0248.11
5.1.40.0030.0258.09
5.1.30.0040.0258.44
5.1.20.0020.0288.46
5.1.10.0040.0268.19
5.1.00.0050.0258.19
5.0.50.0030.0236.67
5.0.40.0040.0206.54
5.0.30.0060.0296.34
5.0.20.0010.0226.31
5.0.10.0030.0206.29
5.0.00.0060.0306.29
4.4.90.0010.0174.77
4.4.80.0000.0184.76
4.4.70.0010.0174.76
4.4.60.0010.0174.75
4.4.50.0020.0164.77
4.4.40.0020.0314.71
4.4.30.0010.0174.76
4.4.20.0030.0154.84
4.4.10.0020.0164.85
4.4.00.0030.0254.76
4.3.110.0010.0174.67
4.3.100.0020.0164.66
4.3.90.0060.0114.64
4.3.80.0030.0244.58
4.3.70.0030.0144.63
4.3.60.0010.0164.63
4.3.50.0030.0164.62
4.3.40.0020.0264.54
4.3.30.0020.0173.33
4.3.20.0030.0193.31
4.3.10.0010.0173.27
4.3.00.0030.0237.30

preferences:
60.53 ms | 401 KiB | 5 Q