3v4l.org

run code in 300+ PHP versions simultaneously
<?php $conf['search_description'] = 160; $keywords = array('maison', 'vente', 'mornagia', 'manouba', '2013'); $description = 'Agence immobilière Dossenheim met en vente duplex a Jdaida d’une superficie 100m² composée d’un salon ,salle à manger, cuisine, 3 chambres à coucher, salle de bain et une salle d’eau ,d’un prix négociable 70MDT avec titre foncier indépendant Pour tout contact'; $plussize = 20; $snippet = ''; $to=0; $entre=0; //$description = utf8_decode($description); if(strlen($description) > $conf['search_description']) { $entre=0; for ($c = 0; $c < count($keywords); $c++) { $current_keyword = $keywords[$c]; $keyword_pos = mb_strpos(strtolower($description), $current_keyword); if($keyword_pos === false) $ddddd=1; //anything else { $entre+=1; $from = max(intval($keyword_pos - $plussize),0,$to); $to = min(intval($keyword_pos + strlen($current_keyword) + $plussize),strlen($description)-1); if ($from>0) $part = '...'; else $part = ''; $part .= mb_substr($description, $from, $to); echo 'part' . $c . '=(' . $part . ') \n '; if(preg_match('/\s/', $part, $m, PREG_OFFSET_CAPTURE)) { $p1 = $m[0][1]+1; } else { $p1 = 0; } if(preg_match('/\s+(?=\S*+$)/', $part, $m, PREG_OFFSET_CAPTURE)) { $p2 = $m[0][1]; } else { $p2 = 0; } //$p1 = (strpos($part,' ')=== false)?0:mb_strpos($part,' ')+1; //$p2 = (strrpos($part,' ')=== false)?0:mb_strrpos($part,' '); echo 'p1='.$p1; echo ' p2 =' . $p2; $snippet .= '[' . substr($part, $p1, $p2) . ']'; if ($to<strlen($description)-1) $snippet .= '...'; } } if(strlen($snippet)< $conf['search_description'] && $to>0 && $to<$conf['search_description'] ) $snippet = $snippet . mb_substr($description,$to,strlen($description)-1, 'UTF-8'); if(strlen($snippet)>0) $description = $snippet; } echo $description;

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.0040.01118.43
8.3.50.0130.00721.20
8.3.40.0190.00318.95
8.3.30.0100.00320.17
8.3.20.0000.00720.34
8.3.10.0040.00421.92
8.3.00.0050.00322.37
8.2.180.0190.00016.75
8.2.170.0070.00722.96
8.2.160.0070.00722.21
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00420.70
8.2.110.0070.00322.44
8.2.100.0040.00817.72
8.2.90.0040.00418.16
8.2.80.0050.00317.97
8.2.70.0030.00617.88
8.2.60.0040.00418.05
8.2.50.0000.00918.07
8.2.40.0040.00418.34
8.2.30.0070.00019.59
8.2.20.0000.00717.85
8.2.10.0000.00717.87
8.2.00.0040.00417.93
8.1.280.0070.00725.92
8.1.270.0050.00323.99
8.1.260.0020.00526.35
8.1.250.0080.00028.09
8.1.240.0080.00320.75
8.1.230.0040.00820.95
8.1.220.0030.00517.78
8.1.210.0040.00418.88
8.1.200.0040.00917.50
8.1.190.0080.00017.53
8.1.180.0060.00318.10
8.1.170.0040.00418.70
8.1.160.0040.00418.98
8.1.150.0040.00418.82
8.1.140.0040.00417.55
8.1.130.0040.00417.80
8.1.120.0040.00417.72
8.1.110.0000.00817.65
8.1.100.0000.00817.46
8.1.90.0000.00717.67
8.1.80.0070.00017.59
8.1.70.0050.00317.63
8.1.60.0030.00617.71
8.1.50.0040.00417.81
8.1.40.0030.00917.77
8.1.30.0080.00017.88
8.1.20.0060.00317.90
8.1.10.0040.00417.79
8.1.00.0000.00817.63
8.0.300.0030.00620.14
8.0.290.0080.00017.05
8.0.280.0040.00418.55
8.0.270.0000.00717.44
8.0.260.0070.00417.04
8.0.250.0060.00317.14
8.0.240.0090.00017.20
8.0.230.0000.00717.19
8.0.220.0000.00717.04
8.0.210.0030.00617.06
8.0.200.0030.00317.25
8.0.190.0000.00717.13
8.0.180.0060.00317.14
8.0.170.0000.00817.07
8.0.160.0030.00516.96
8.0.150.0080.00017.15
8.0.140.0060.00316.98
8.0.130.0000.00613.59
8.0.120.0040.00417.14
8.0.110.0000.00717.07
8.0.100.0040.00417.19
8.0.90.0070.00017.00
8.0.80.0090.00617.11
8.0.70.0040.00416.96
8.0.60.0030.00517.15
8.0.50.0040.00417.04
8.0.30.0100.01317.14
8.0.20.0090.01517.40
8.0.10.0030.00517.20
8.0.00.0110.00816.99
7.4.330.0050.00016.67
7.4.320.0030.00316.84
7.4.300.0060.00016.82
7.4.290.0040.00416.70
7.4.280.0040.00416.73
7.4.270.0040.00416.67
7.4.260.0000.00513.46
7.4.250.0030.00616.82
7.4.240.0040.00316.78
7.4.230.0070.00016.86
7.4.220.0160.00316.70
7.4.210.0060.01016.82
7.4.200.0070.00016.84
7.4.190.0070.00016.66
7.4.160.0090.00916.89
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0100.01116.71
7.4.120.0090.00916.79
7.4.110.0060.01016.78
7.4.100.0090.01216.57
7.4.90.0180.00016.88
7.4.80.0030.01419.39
7.4.70.0070.01116.95
7.4.60.0110.00516.75
7.4.50.0000.00916.71
7.4.40.0070.01322.77
7.4.30.0060.01016.68
7.4.00.0060.01015.11
7.3.330.0030.00313.30
7.3.320.0050.00013.24
7.3.310.0030.00316.37
7.3.300.0030.00316.51
7.3.290.0070.00716.54
7.3.280.0120.00416.59
7.3.270.0070.01017.40
7.3.260.0080.01118.24
7.3.250.0150.00316.67
7.3.240.0070.01616.83
7.3.230.0120.00616.56
7.3.210.0130.00716.78
7.3.200.0070.01019.39
7.3.190.0100.01016.85
7.3.180.0060.01016.45
7.3.170.0060.01016.50
7.3.160.0110.01116.89
7.3.120.0110.00415.06
7.3.10.0040.01116.57
7.3.00.0040.01116.46
7.2.330.0060.01216.75
7.2.320.0030.01416.97
7.2.310.0120.00617.01
7.2.300.0060.01117.01
7.2.290.0110.00716.85
7.2.130.0000.01617.07
7.2.120.0120.00317.00
7.2.110.0140.00716.92
7.2.100.0000.01517.10
7.2.90.0090.00917.18
7.2.80.0160.00316.97
7.2.70.0130.00617.24
7.2.60.0100.01616.75
7.2.50.0160.00317.16
7.2.40.0150.00316.99
7.2.30.0080.01617.11
7.2.20.0140.00717.12
7.2.10.0130.00616.81
7.2.00.0040.01416.95
7.1.250.0130.00615.84
7.1.70.0040.00417.30
7.1.60.0090.01519.17
7.1.50.0060.00617.28
7.1.00.0070.05722.46
7.0.200.0080.00016.90
7.0.140.0030.07322.18
7.0.80.0130.08021.77
7.0.70.0070.07321.70
7.0.60.0130.08021.73
7.0.50.0100.05322.14
7.0.40.0100.06319.95
7.0.30.0230.06320.05
7.0.20.0070.07720.04
7.0.10.0070.08020.08
7.0.00.0130.07720.14
5.6.280.0000.07720.77
5.6.230.0030.08720.68
5.6.220.0100.08320.71
5.6.210.0170.07320.65
5.6.200.0030.06020.95
5.6.190.0200.07321.01
5.6.180.0130.05021.05
5.6.170.0070.05021.03
5.6.160.0070.04720.94
5.6.150.0030.06721.11
5.6.140.0070.08321.07
5.6.130.0070.07021.18
5.6.120.0100.07721.05
5.6.110.0100.04321.04
5.6.100.0070.08321.07
5.6.90.0030.05021.13
5.6.80.0070.05020.42
5.6.70.0070.05720.34
5.6.60.0100.08020.39
5.6.50.0130.04720.50
5.6.40.0030.05320.39
5.6.30.0170.06320.31
5.6.20.0100.08020.47
5.6.10.0030.05320.39
5.6.00.0130.07320.49
5.5.370.0030.08020.45
5.5.360.0100.07720.54
5.5.350.0170.06720.44
5.5.340.0070.08020.82
5.5.330.0100.08020.88
5.5.320.0000.07320.85
5.5.310.0030.09020.92
5.5.300.0070.05320.79
5.5.290.0230.06720.90
5.5.280.0130.07720.83
5.5.270.0100.08720.73
5.5.260.0130.08320.84
5.5.250.0130.07720.55
5.5.240.0170.07020.04
5.5.230.0070.05020.30
5.5.220.0070.05020.21
5.5.210.0000.04320.20
5.5.200.0030.08320.13
5.5.190.0100.06020.10
5.5.180.0100.07320.16
5.5.160.0130.07720.23
5.5.150.0170.07320.22
5.5.140.0070.08320.00
5.5.130.0000.08320.09
5.5.120.0030.07320.16
5.5.110.0030.06320.25
5.5.100.0030.08720.09
5.5.90.0200.06320.13
5.5.80.0070.05320.11
5.5.70.0100.08020.16
5.5.60.0070.05020.10
5.5.50.0030.04020.16
5.5.40.0030.07320.16
5.5.30.0170.07020.16
5.5.20.0030.08320.13
5.5.10.0130.07319.97
5.5.00.0130.04720.05
5.4.450.0000.07019.44
5.4.440.0000.08719.46
5.4.430.0070.08019.48
5.4.420.0070.08319.45
5.4.410.0070.06719.25
5.4.400.0100.06019.15
5.4.390.0070.04019.12
5.4.380.0070.04019.04
5.4.370.0130.07019.12
5.4.360.0070.06319.12
5.4.350.0030.08318.78
5.4.340.0070.08019.07
5.4.320.0030.08018.81
5.4.310.0070.07019.03
5.4.300.0130.05719.12
5.4.290.0070.04319.02
5.4.280.0070.07719.14
5.4.270.0130.06718.94
5.4.260.0030.04719.02
5.4.250.0030.07718.78
5.4.240.0030.06319.09
5.4.230.0070.05719.22
5.4.220.0070.08018.97
5.4.210.0000.05718.98
5.4.200.0030.04719.02
5.4.190.0030.04318.96
5.4.180.0030.07019.08
5.4.170.0070.07719.13
5.4.160.0100.06018.76
5.4.150.0070.09019.01
5.4.140.0000.05716.24
5.4.130.0000.04316.29
5.4.120.0030.07716.41
5.4.110.0100.07016.23
5.4.100.0000.07016.25
5.4.90.0070.04716.25
5.4.80.0100.07016.30
5.4.70.0070.06716.21
5.4.60.0030.06316.28
5.4.50.0000.04316.23
5.4.40.0070.03016.37
5.4.30.0030.03716.24
5.4.20.0030.04016.28
5.4.10.0130.03016.33
5.4.00.0030.03315.75
5.3.290.0030.08014.69
5.3.280.0100.07314.47
5.3.270.0030.06014.59
5.3.260.0130.07314.49
5.3.250.0100.07314.48
5.3.240.0030.03714.56
5.3.230.0070.04014.55
5.3.220.0000.05014.45
5.3.210.0100.06714.59
5.3.200.0070.04714.59
5.3.190.0000.05014.55
5.3.180.0030.07314.45
5.3.170.0000.06014.46
5.3.160.0000.04314.53
5.3.150.0030.03714.52
5.3.140.0000.04014.54
5.3.130.0030.04314.48
5.3.120.0000.04014.55
5.3.110.0000.06314.56
5.3.100.0030.05013.93
5.3.90.0030.04013.89
5.3.80.0000.05714.00
5.3.70.0130.02713.90
5.3.60.0070.03014.02
5.3.50.0000.04313.91
5.3.40.0030.03013.93
5.3.30.0100.04713.91
5.3.20.0030.04013.71
5.3.10.0070.04313.48
5.3.00.0030.03313.51
5.2.170.0000.02711.62
5.2.160.0030.02711.62
5.2.150.0000.02711.62
5.2.140.0030.02711.62
5.2.130.0070.03711.62
5.2.120.0000.03011.62
5.2.110.0000.03011.62
5.2.100.0030.02711.62
5.2.90.0000.03011.62
5.2.80.0000.03011.62
5.2.70.0000.04311.62
5.2.60.0030.02711.62
5.2.50.0030.06011.62
5.2.40.0000.05311.62
5.2.30.0030.03011.62
5.2.20.0000.03011.62
5.2.10.0030.02711.62
5.2.00.0000.02711.62
5.1.60.0070.02311.62
5.1.50.0030.02011.62
5.1.40.0000.02711.62
5.1.30.0030.03011.62
5.1.20.0000.02711.62
5.1.10.0000.02311.62
5.1.00.0000.03711.62
5.0.50.0030.02011.62
5.0.40.0000.01711.62
5.0.30.0000.03711.62
5.0.20.0030.01711.62
5.0.10.0000.01711.62
5.0.00.0000.02711.62
4.4.90.0000.01711.62
4.4.80.0000.02711.62
4.4.70.0000.01711.62
4.4.60.0030.01311.62
4.4.50.0000.01711.62
4.4.40.0000.02311.62
4.4.30.0000.01711.62
4.4.20.0000.01711.62
4.4.10.0000.01711.62
4.4.00.0000.02311.62
4.3.110.0000.02311.62
4.3.100.0000.01311.62
4.3.90.0000.01311.62
4.3.80.0030.01711.62
4.3.70.0000.02311.62
4.3.60.0000.02011.62
4.3.50.0030.01311.62
4.3.40.0030.02311.62
4.3.30.0000.01711.62
4.3.20.0000.01711.62
4.3.10.0000.03311.62
4.3.00.0000.02011.62

preferences:
40.84 ms | 401 KiB | 5 Q