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]-5; } 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 . substr($description,$p2+10,strlen($description)-1); 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.0140.00716.88
8.3.50.0090.00716.53
8.3.40.0000.01519.05
8.3.30.0100.01318.97
8.3.20.0080.00019.02
8.3.10.0040.00420.78
8.3.00.0030.00519.63
8.2.180.0140.00716.63
8.2.170.0110.00422.96
8.2.160.0150.00321.27
8.2.150.0000.00824.18
8.2.140.0070.00324.66
8.2.130.0070.00726.16
8.2.120.0080.00020.08
8.2.110.0090.00021.25
8.2.100.0060.00617.84
8.2.90.0030.00619.47
8.2.80.0000.00819.28
8.2.70.0000.00817.75
8.2.60.0110.00018.04
8.2.50.0060.00318.07
8.2.40.0000.00818.34
8.2.30.0050.00318.12
8.2.20.0020.00517.89
8.2.10.0060.00317.91
8.2.00.0060.00617.80
8.1.280.0110.00725.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0080.00422.20
8.1.230.0110.00020.85
8.1.220.0080.00017.79
8.1.210.0000.00918.89
8.1.200.0090.00017.60
8.1.190.0080.00017.50
8.1.180.0030.00618.10
8.1.170.0000.00918.89
8.1.160.0000.00918.98
8.1.150.0040.00418.81
8.1.140.0040.00717.66
8.1.130.0040.00417.82
8.1.120.0000.00717.64
8.1.110.0000.00717.55
8.1.100.0030.00517.54
8.1.90.0070.00017.64
8.1.80.0030.00317.66
8.1.70.0040.00417.61
8.1.60.0050.00317.82
8.1.50.0000.00717.59
8.1.40.0000.00817.67
8.1.30.0090.00017.80
8.1.20.0040.00417.94
8.1.10.0000.00817.84
8.1.00.0090.00017.71
8.0.300.0070.00020.13
8.0.290.0000.00817.00
8.0.280.0030.00318.63
8.0.270.0090.00017.36
8.0.260.0030.00318.54
8.0.250.0040.00417.17
8.0.240.0100.00017.19
8.0.230.0000.00717.16
8.0.220.0040.00417.09
8.0.210.0030.00317.11
8.0.200.0040.00417.08
8.0.190.0040.00417.19
8.0.180.0000.00817.18
8.0.170.0000.00917.19
8.0.160.0040.00417.12
8.0.150.0090.00017.06
8.0.140.0060.00317.07
8.0.130.0030.00313.57
8.0.120.0040.00417.09
8.0.110.0050.00317.10
8.0.100.0000.00717.03
8.0.90.0050.00317.14
8.0.80.0070.01117.19
8.0.70.0040.00417.02
8.0.60.0040.00417.01
8.0.50.0040.00417.12
8.0.30.0150.00417.23
8.0.20.0050.01317.12
8.0.10.0000.00717.15
8.0.00.0080.01016.85
7.4.330.0000.00513.20
7.4.320.0030.00316.84
7.4.300.0000.00616.85
7.4.290.0050.00316.85
7.4.280.0070.00216.68
7.4.270.0060.00316.72
7.4.260.0000.00613.54
7.4.250.0040.00416.83
7.4.240.0070.00016.89
7.4.230.0040.00416.65
7.4.220.0150.00916.68
7.4.210.0110.00616.89
7.4.200.0050.00216.55
7.4.190.0000.00816.84
7.4.160.0030.01316.78
7.4.150.0140.00616.98
7.4.140.0080.01116.64
7.4.130.0120.00616.85
7.4.120.0060.01116.89
7.4.110.0080.01116.73
7.4.100.0190.00016.70
7.4.90.0110.01416.57
7.4.80.0100.00716.60
7.4.70.0060.01616.71
7.4.60.0070.01116.64
7.4.50.0000.00516.83
7.4.40.0070.00716.64
7.4.30.0100.00616.91
7.4.00.0060.01115.21
7.3.330.0000.00713.32
7.3.320.0030.00313.44
7.3.310.0030.00316.59
7.3.300.0000.00716.34
7.3.290.0120.00616.50
7.3.280.0060.01116.49
7.3.270.0070.01016.42
7.3.260.0080.00916.75
7.3.250.0090.01316.74
7.3.240.0180.00016.54
7.3.230.0130.00716.79
7.3.210.0100.00616.66
7.3.200.0110.00619.39
7.3.190.0120.00916.44
7.3.180.0100.00716.77
7.3.170.0070.01316.80
7.3.160.0070.01016.55
7.3.120.0060.01015.23
7.3.110.0070.00715.11
7.3.100.0060.01015.27
7.3.90.0070.00315.24
7.3.80.0030.01015.05
7.3.70.0030.00615.21
7.3.60.0070.00714.86
7.3.50.0030.00815.13
7.3.40.0090.00615.02
7.3.30.0000.01415.08
7.3.20.0000.01417.01
7.3.10.0070.00716.84
7.3.00.0120.00616.65
7.2.330.0090.00916.84
7.2.320.0110.00616.83
7.2.310.0090.01516.81
7.2.300.0030.01516.88
7.2.290.0130.01016.86
7.2.250.0070.01115.41
7.2.240.0090.00915.13
7.2.230.0030.01415.20
7.2.220.0030.01015.40
7.2.210.0070.01015.44
7.2.200.0040.01115.13
7.2.190.0070.00715.27
7.2.180.0030.01315.29
7.2.170.0070.00715.49
7.2.130.0110.00616.96
7.2.120.0110.00717.13
7.2.110.0100.01417.07
7.2.100.0070.01017.14
7.2.90.0160.00617.18
7.2.80.0090.00717.08
7.2.70.0190.00316.95
7.2.60.0100.01017.12
7.2.50.0180.00417.02
7.2.40.0070.01417.28
7.2.30.0150.00417.14
7.2.20.0100.00717.24
7.2.10.0090.00617.06
7.2.00.0090.00918.24
7.1.330.0080.00815.88
7.1.320.0060.00916.20
7.1.310.0120.00315.91
7.1.300.0030.01316.03
7.1.290.0040.00816.16
7.1.280.0110.00415.78
7.1.270.0030.01416.06
7.1.260.0060.00916.18
7.1.250.0150.00015.88
7.1.240.0090.00915.75
7.1.230.0150.00515.84
7.1.220.0150.00716.01
7.1.210.0040.01615.95
7.1.200.0080.00815.95
7.1.190.0130.00315.88
7.1.180.0130.00716.02
7.1.170.0180.00316.13
7.1.160.0100.00615.91
7.1.150.0060.01215.65
7.1.140.0130.00315.84
7.1.130.0110.00416.09
7.1.120.0120.00415.78
7.1.110.0070.01115.90
7.1.100.0090.00617.20
7.1.90.0000.01615.77
7.1.80.0160.00316.16
7.1.70.0110.00316.73
7.1.60.0090.01117.59
7.1.50.0080.01516.60
7.1.40.0110.00515.96
7.1.30.0120.00615.75
7.1.20.0070.00716.10
7.1.10.0140.00415.92
7.1.00.0070.04019.12
7.0.330.0130.00715.64
7.0.320.0090.01515.74
7.0.310.0080.00815.39
7.0.300.0100.00515.79
7.0.290.0120.00615.25
7.0.280.0100.00315.27
7.0.270.0100.00715.52
7.0.260.0090.00415.42
7.0.250.0120.00315.71
7.0.240.0070.00715.33
7.0.230.0170.00315.55
7.0.220.0130.00715.53
7.0.210.0130.00715.50
7.0.200.0060.00616.15
7.0.190.0100.00315.39
7.0.180.0090.00915.63
7.0.170.0110.00715.49
7.0.160.0100.00715.63
7.0.150.0140.00615.26
7.0.140.0060.04318.63
7.0.130.0100.01015.32
7.0.120.0100.03818.94
7.0.110.0070.01115.77
7.0.100.0100.01015.60
7.0.90.0130.00615.67
7.0.80.0090.00915.39
7.0.70.0130.00015.52
7.0.60.0120.03517.74
7.0.50.0070.04516.75
7.0.40.0040.04116.97
7.0.30.0350.03517.02
7.0.20.0190.03316.81
7.0.10.0100.04316.86
7.0.00.0090.02316.79
5.6.380.0070.00714.46
5.6.370.0110.00414.18
5.6.360.0030.01014.64
5.6.350.0000.01114.43
5.6.340.0070.00714.86
5.6.330.0110.00714.17
5.6.320.0080.00814.91
5.6.310.0120.00314.56
5.6.300.0030.01114.68
5.6.290.0090.00014.52
5.6.280.0020.04217.91
5.6.270.0030.01014.36
5.6.260.0000.01314.68
5.6.250.0070.01014.39
5.6.240.0080.00414.77
5.6.230.0050.00514.54
5.6.220.0100.00714.32
5.6.210.0160.03817.50
5.6.200.0070.04516.31
5.6.190.0030.03017.51
5.6.180.0050.03517.42
5.6.170.0120.03217.39
5.6.160.0130.03817.53
5.6.150.0110.04316.32
5.6.140.0050.04516.28
5.6.130.0030.02316.24
5.6.120.0080.03217.81
5.6.110.0070.04317.83
5.6.100.0060.02417.80
5.6.90.0110.04517.63
5.6.80.0050.02817.29
5.6.70.2350.02217.31
5.6.60.0030.01014.64
5.6.50.0000.01214.56
5.6.40.0090.00314.26
5.6.30.0110.00414.29
5.6.20.0030.00914.11
5.6.10.0060.00814.11
5.6.00.0040.01214.73
5.5.380.0060.00611.28
5.5.370.0040.00411.11
5.5.360.0030.00311.47
5.5.350.0090.02615.79
5.5.340.0060.03114.67
5.5.330.0000.04915.71
5.5.320.0110.02415.67
5.5.310.0160.02515.93
5.5.300.0090.04014.63
5.5.290.0030.02214.71
5.5.280.0020.04215.96
5.5.270.0070.02515.99
5.5.260.0050.03416.05
5.5.250.0060.04515.80
5.5.240.0200.03715.71
5.5.230.0060.00611.24
5.5.220.0070.00711.36
5.5.210.0000.01311.41
5.5.200.0110.00311.22
5.5.190.0080.00311.34
5.5.180.0110.00311.26
5.5.170.0110.00411.22
5.5.160.0060.00610.92
5.5.150.0030.00511.29
5.5.140.0000.01211.27
5.5.130.0090.00311.38
5.5.120.0080.00510.90
5.5.110.0050.00710.98
5.5.100.0040.01111.20
5.5.90.0000.01311.17
5.5.80.0030.00610.90
5.5.70.0060.00911.01
5.5.60.0000.01511.03
5.5.50.0000.01411.20
5.5.40.0040.00711.13
5.5.30.0000.00811.41
5.5.20.0090.00011.36
5.5.10.0100.00011.37
5.5.00.0070.00311.30
5.4.450.0110.01815.28
5.4.440.0040.03415.27
5.4.430.0080.04115.11
5.4.420.0080.04215.18
5.4.410.0070.04015.02
5.4.400.0060.04015.02
5.4.390.0090.02015.13
5.4.380.0050.03615.02
5.4.370.0080.03815.14
5.4.360.0050.04215.09
5.4.350.0030.03514.94
5.4.340.0100.03615.06
5.4.330.0000.00911.35
5.4.320.0050.02915.09
5.4.310.0080.03115.22
5.4.300.0050.03514.95
5.4.290.0030.04315.05
5.4.280.0080.03714.99
5.4.270.0060.03815.15
5.4.260.0090.01914.98
5.4.250.0080.04015.12
5.4.240.0000.04914.90
5.4.230.0070.02515.09
5.4.220.0030.04615.03
5.4.210.0050.04015.06
5.4.200.0090.03815.01
5.4.190.0030.02815.10
5.4.180.0070.01815.17
5.4.170.0090.02514.90
5.4.160.0080.03515.02
5.4.150.0040.03215.08
5.4.140.0050.02313.79
5.4.130.0030.04013.59
5.4.120.0070.03613.59
5.4.110.0020.03113.64
5.4.100.0040.04113.81
5.4.90.0090.03113.81
5.4.80.0080.01713.82
5.4.70.0080.02713.84
5.4.60.0130.02713.91
5.4.50.0030.02213.72
5.4.40.0060.02013.60
5.4.30.0050.02213.78
5.4.20.0050.02513.91
5.4.10.0030.02813.71
5.4.00.0030.02513.48
5.3.290.0010.03112.76
5.3.280.0090.01812.65
5.3.270.0040.04312.73
5.3.260.0030.04512.73
5.3.250.0120.01912.72
5.3.240.0080.02712.74
5.3.230.0020.04712.65
5.3.220.0080.02112.71
5.3.210.0030.02412.71
5.3.200.0070.01812.71
5.3.190.0000.03712.71
5.3.180.0080.03312.71
5.3.170.0060.02512.79
5.3.160.0050.02512.71
5.3.150.0050.03312.63
5.3.140.0040.02212.71
5.3.130.0070.02312.78
5.3.120.0050.02512.64
5.3.110.0080.03812.67
5.3.100.0060.02912.44
5.3.90.0070.02012.44
5.3.80.0060.02412.48
5.3.70.0110.03612.43
5.3.60.0070.04212.47
5.3.50.0100.02512.44
5.3.40.0050.03312.39
5.3.30.0040.03012.38
5.3.20.0040.02612.27
5.3.10.0110.03512.26
5.3.00.0020.03212.25
5.2.170.0070.02011.00
5.2.160.0080.02611.03
5.2.150.0060.03010.96
5.2.140.0080.01511.11
5.2.130.0080.03010.98
5.2.120.0100.02510.98
5.2.110.0040.03711.05
5.2.100.0040.02210.97
5.2.90.0040.02410.98
5.2.80.0020.02211.08
5.2.70.0040.02010.99
5.2.60.0040.02410.97
5.2.50.0030.02010.95
5.2.40.0040.02010.93
5.2.30.0070.01310.95
5.2.20.0050.01710.90
5.2.10.0060.01510.90
5.2.00.0040.02010.82
5.1.60.0030.01810.48
5.1.50.0040.01610.48
5.1.40.0030.02510.44
5.1.30.0030.03310.64
5.1.20.0070.02810.66
5.1.10.0000.02310.48
5.1.00.0070.01310.49
5.0.50.0000.0169.77
5.0.40.0040.0139.67
5.0.30.0040.0239.58
5.0.20.0060.0129.52
5.0.10.0070.0159.56
5.0.00.0020.0249.55
4.4.90.0020.0209.39
4.4.80.0050.0099.39
4.4.70.0000.0109.39
4.4.60.0000.0119.39
4.4.50.0010.0109.39
4.4.40.0030.0159.39
4.4.30.0000.0199.39
4.4.20.0010.0169.39
4.4.10.0020.0109.39
4.4.00.0030.0209.39
4.3.110.0030.0119.39
4.3.100.0050.0099.39
4.3.90.0040.0089.39
4.3.80.0040.0159.39
4.3.70.0040.0129.39
4.3.60.0010.0139.39
4.3.50.0030.0189.39
4.3.40.0000.0249.39
4.3.30.0010.0139.39
4.3.20.0030.0189.39
4.3.10.0030.0199.39
4.3.00.0010.0119.39

preferences:
42.67 ms | 401 KiB | 5 Q