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]-3; } 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.55
8.3.50.0080.01022.03
8.3.40.0180.00019.09
8.3.30.0120.00318.93
8.3.20.0000.00820.16
8.3.10.0080.00023.53
8.3.00.0080.00022.37
8.2.180.0150.00316.88
8.2.170.0110.00422.96
8.2.160.0130.00322.21
8.2.150.0040.00424.18
8.2.140.0110.00724.66
8.2.130.0000.00726.16
8.2.120.0050.00319.73
8.2.110.0070.00322.17
8.2.100.0040.00817.68
8.2.90.0040.00419.17
8.2.80.0080.00017.97
8.2.70.0050.00317.88
8.2.60.0040.00418.16
8.2.50.0040.00418.07
8.2.40.0000.00718.28
8.2.30.0000.00818.13
8.2.20.0040.00418.01
8.2.10.0050.00317.99
8.2.00.0040.00417.93
8.1.280.0090.00925.92
8.1.270.0000.00822.31
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.84
8.1.230.0030.00919.01
8.1.220.0080.00017.78
8.1.210.0040.00418.77
8.1.200.0110.00017.60
8.1.190.0000.00817.52
8.1.180.0090.00018.10
8.1.170.0040.00418.72
8.1.160.0080.00022.07
8.1.150.0000.00818.80
8.1.140.0000.00717.63
8.1.130.0000.00717.79
8.1.120.0000.00917.70
8.1.110.0000.00817.68
8.1.100.0000.00717.53
8.1.90.0050.00317.64
8.1.80.0000.00717.64
8.1.70.0040.00417.59
8.1.60.0060.00317.71
8.1.50.0000.00817.64
8.1.40.0040.00417.77
8.1.30.0040.00417.75
8.1.20.0030.00617.89
8.1.10.0000.00817.81
8.1.00.0080.00017.80
8.0.300.0040.00418.77
8.0.290.0050.00317.30
8.0.280.0040.00418.57
8.0.270.0000.00717.25
8.0.260.0030.00317.07
8.0.250.0000.00717.16
8.0.240.0000.00717.07
8.0.230.0030.00317.16
8.0.220.0070.00017.17
8.0.210.0070.00017.04
8.0.200.0030.00317.23
8.0.190.0070.00017.10
8.0.180.0070.00417.04
8.0.170.0050.00317.12
8.0.160.0040.00417.06
8.0.150.0040.00417.14
8.0.140.0000.00916.96
8.0.130.0000.00913.43
8.0.120.0050.00317.00
8.0.110.0030.00517.04
8.0.100.0040.00417.11
8.0.90.0040.00417.19
8.0.80.0150.00017.09
8.0.70.0040.00417.16
8.0.60.0040.00416.98
8.0.50.0030.00517.19
8.0.30.0180.00617.55
8.0.20.0090.00917.47
8.0.10.0040.00417.04
8.0.00.0110.01017.01
7.4.330.0000.00615.00
7.4.320.0030.00316.75
7.4.300.0000.00616.73
7.4.290.0070.00016.79
7.4.280.0080.00016.66
7.4.270.0030.00616.72
7.4.260.0030.00516.73
7.4.250.0030.00516.80
7.4.240.0020.00616.75
7.4.230.0000.00716.73
7.4.220.0100.01316.93
7.4.210.0050.00916.87
7.4.200.0070.00016.87
7.4.190.0050.00216.79
7.4.160.0080.00816.78
7.4.150.0040.01617.40
7.4.140.0130.00717.86
7.4.130.0140.01016.75
7.4.120.0120.00616.75
7.4.110.0070.01016.66
7.4.100.0090.01216.55
7.4.90.0060.01716.74
7.4.80.0110.00516.83
7.4.70.0040.01316.66
7.4.60.0120.00616.77
7.4.50.0060.00316.68
7.4.40.0110.01022.77
7.4.30.0090.01116.73
7.4.00.0060.00615.25
7.3.330.0030.00313.48
7.3.320.0050.00013.34
7.3.310.0070.00016.58
7.3.300.0030.00316.47
7.3.290.0090.00516.43
7.3.280.0070.01016.51
7.3.270.0130.00417.40
7.3.260.0070.01016.54
7.3.250.0120.00716.64
7.3.240.0080.00816.61
7.3.230.0030.01416.82
7.3.210.0120.00616.64
7.3.200.0120.00919.39
7.3.190.0110.00816.57
7.3.180.0070.01016.64
7.3.170.0060.01116.63
7.3.160.0090.00616.62
7.3.120.0040.00915.02
7.3.10.0090.00616.94
7.3.00.0070.00816.78
7.2.330.0060.01216.97
7.2.320.0130.00616.73
7.2.310.0100.01316.86
7.2.300.0120.01016.84
7.2.290.0070.01716.79
7.2.130.0070.01217.10
7.2.120.0040.01117.24
7.2.110.0130.00317.09
7.2.100.0100.00517.13
7.2.90.0080.00617.21
7.2.80.0090.00517.18
7.2.70.0050.01016.96
7.2.60.0100.00617.07
7.2.50.0060.00717.03
7.2.40.0030.01117.13
7.2.30.0090.00717.09
7.2.20.0110.00617.12
7.2.10.0050.01117.24
7.2.00.0050.01117.04
7.1.250.0060.00915.79
7.1.240.0090.00916.11
7.1.230.0070.00715.85
7.1.220.0230.00015.64
7.1.210.0110.01115.92
7.1.200.0060.00615.97
7.1.190.0130.00615.92
7.1.180.0070.00715.96
7.1.170.0160.00315.86
7.1.160.0120.00316.07
7.1.150.0050.00816.03
7.1.140.0030.01315.99
7.1.130.0070.01015.79
7.1.120.0030.01316.08
7.1.110.0080.00815.80
7.1.100.0060.00816.11
7.1.90.0130.00616.09
7.1.80.0000.01615.96
7.1.70.0090.00516.64
7.1.60.0080.01417.59
7.1.50.0050.01516.64
7.1.40.0140.00615.71
7.1.30.0100.00716.02
7.1.20.0030.01316.02
7.1.10.0080.00915.63
7.1.00.0100.03619.08
7.0.330.0090.00615.43
7.0.320.0130.00415.47
7.0.310.0040.01215.59
7.0.300.0120.00615.64
7.0.290.0070.00715.40
7.0.280.0070.01015.44
7.0.270.0120.00615.24
7.0.260.0070.01315.29
7.0.250.0100.00615.79
7.0.240.0060.00915.59
7.0.230.0100.00515.59
7.0.220.0080.00315.35
7.0.210.0060.00615.50
7.0.200.0090.00616.12
7.0.190.0060.00915.68
7.0.180.0110.00715.46
7.0.170.0110.00015.35
7.0.160.0100.00615.58
7.0.150.0070.00715.48
7.0.140.0060.03818.77
7.0.130.0070.00715.61
7.0.120.0150.00615.27
7.0.110.0070.00315.43
7.0.100.0130.00315.66
7.0.90.0060.00615.79
7.0.80.0030.01015.63
7.0.70.0100.04318.55
7.0.60.0090.02618.53
7.0.50.0020.04218.86
7.0.40.0060.02616.92
7.0.30.0030.04816.89
7.0.20.0030.03216.71
7.0.10.0030.04116.74
7.0.00.0120.04016.83
5.6.380.0040.01214.50
5.6.370.0040.01114.30
5.6.360.0100.00714.40
5.6.350.0090.00914.34
5.6.340.0130.00714.12
5.6.330.0100.00914.26
5.6.320.0040.00814.46
5.6.310.0110.00414.32
5.6.300.0110.00314.12
5.6.290.0120.00314.33
5.6.280.0020.04417.70
5.6.270.0000.01214.34
5.6.260.0070.00714.28
5.6.250.0100.00314.64
5.6.240.0040.00414.71
5.6.230.0030.00914.38
5.6.220.0000.04117.40
5.6.210.0020.03517.64
5.6.200.0060.05017.85
5.6.190.0070.02317.85
5.6.180.0110.03917.68
5.6.170.0090.04417.73
5.6.160.0070.02717.73
5.6.150.0020.04117.77
5.6.140.0070.04617.74
5.6.130.0080.03317.70
5.6.120.0050.04817.77
5.6.110.0090.04317.85
5.6.100.0050.04417.58
5.6.90.0100.02717.63
5.6.80.0000.04717.38
5.6.70.0030.03317.37
5.6.60.0040.03917.44
5.6.50.0050.03817.56
5.6.40.0100.04017.36
5.6.30.0060.03117.40
5.6.20.0070.03717.25
5.6.10.0110.03917.44
5.6.00.0060.04317.38
5.5.380.0000.01111.19
5.5.370.0000.01211.25
5.5.360.0040.03715.76
5.5.350.0030.03115.96
5.5.340.0050.04516.06
5.5.330.0050.04615.99
5.5.320.0130.02815.99
5.5.310.0070.04016.03
5.5.300.0050.04616.00
5.5.290.0020.03316.13
5.5.280.0040.04515.95
5.5.270.0030.03516.07
5.5.260.0030.04516.04
5.5.250.0000.04015.99
5.5.240.0050.04415.76
5.5.230.0030.04515.76
5.5.220.0060.04415.68
5.5.210.0060.04115.72
5.5.200.0080.03215.73
5.5.190.0080.03815.71
5.5.180.0030.03015.67
5.5.170.0030.00711.06
5.5.160.0060.03615.61
5.5.150.0090.03215.59
5.5.140.0050.04415.66
5.5.130.0050.04215.69
5.5.120.0030.04515.66
5.5.110.0060.04315.83
5.5.100.0050.04415.53
5.5.90.0050.02815.62
5.5.80.0080.01615.67
5.5.70.0050.02615.71
5.5.60.0080.03715.66
5.5.50.0060.04215.56
5.5.40.0000.03315.60
5.5.30.0110.03315.60
5.5.20.0060.04315.61
5.5.10.0100.03815.59
5.5.00.0100.02515.63
5.4.450.0020.03415.31
5.4.440.0030.04415.26
5.4.430.0070.04215.23
5.4.420.0080.03815.21
5.4.410.0030.02815.25
5.4.400.0070.02915.11
5.4.390.0080.02515.15
5.4.380.0080.03915.10
5.4.370.0080.03615.08
5.4.360.0060.03615.05
5.4.350.0050.04015.06
5.4.340.0030.02315.05
5.4.330.0000.01111.06
5.4.320.0050.04315.08
5.4.310.0060.03015.14
5.4.300.0080.04215.08
5.4.290.0090.03315.07
5.4.280.0060.03815.09
5.4.270.0100.03815.10
5.4.260.0030.04315.14
5.4.250.0060.02815.20
5.4.240.0020.04515.14
5.4.230.0040.04215.04
5.4.220.0050.03015.14
5.4.210.0000.03815.12
5.4.200.0020.02715.17
5.4.190.0030.03515.09
5.4.180.0030.03815.07
5.4.170.0000.03815.19
5.4.160.0060.03814.96
5.4.150.0060.04115.02
5.4.140.0050.03013.59
5.4.130.0020.03613.79
5.4.120.0050.03713.74
5.4.110.0030.04213.67
5.4.100.0050.03613.64
5.4.90.0030.04113.76
5.4.80.0040.03713.71
5.4.70.0050.02713.63
5.4.60.0020.03813.72
5.4.50.0080.03213.79
5.4.40.0090.03813.86
5.4.30.0030.02813.84
5.4.20.0030.04113.82
5.4.10.0060.04013.76
5.4.00.0060.02713.55
5.3.290.0060.04312.79
5.3.280.0050.04212.82
5.3.270.0050.04412.76
5.3.260.0050.04012.84
5.3.250.0060.04012.84
5.3.240.0030.04012.82
5.3.230.0070.04012.80
5.3.220.0030.03912.79
5.3.210.0070.04112.78
5.3.200.0050.03412.76
5.3.190.0050.04112.75
5.3.180.0050.04012.83
5.3.170.0020.03612.81
5.3.160.0040.02512.83
5.3.150.0030.04312.83
5.3.140.0060.03812.83
5.3.130.0070.03812.82
5.3.120.0050.04012.78
5.3.110.0090.03912.80
5.3.100.0050.03812.53
5.3.90.0020.04612.55
5.3.80.0050.03712.52
5.3.70.0080.03612.55
5.3.60.0030.04112.48
5.3.50.0030.04112.49
5.3.40.0050.03612.45
5.3.30.0050.03112.46
5.3.20.0060.03612.27
5.3.10.0050.03712.35
5.3.00.0050.03912.33
5.2.170.0000.03011.67
5.2.160.0030.01811.67
5.2.150.0030.02911.67
5.2.140.0080.03211.67
5.2.130.0020.03811.67
5.2.120.0000.03711.67
5.2.110.0020.03711.67
5.2.100.0050.02211.67
5.2.90.0060.03111.67
5.2.80.0050.03211.67
5.2.70.0070.03011.67
5.2.60.0010.03111.67
5.2.50.0050.03211.67
5.2.40.0020.03611.67
5.2.30.0060.03511.67
5.2.20.0030.02911.67
5.2.10.0030.03211.67
5.2.00.0060.01511.67
5.1.60.0030.02011.67
5.1.50.0050.02811.67
5.1.40.0050.02011.67
5.1.30.0090.02711.67
5.1.20.0060.02711.67
5.1.10.0050.02511.67
5.1.00.0030.03011.67
5.0.50.0000.02311.67
5.0.40.0040.02111.67
5.0.30.0020.03711.67
5.0.20.0020.02511.67
5.0.10.0040.02211.67
5.0.00.0040.03311.67
4.4.90.0020.01311.67
4.4.80.0030.01211.67
4.4.70.0000.02211.67
4.4.60.0020.01411.67
4.4.50.0030.01811.67
4.4.40.0000.01811.67
4.4.30.0030.01611.67
4.4.20.0000.02211.67
4.4.10.0040.01811.67
4.4.00.0060.02511.67
4.3.110.0000.02211.67
4.3.100.0020.01211.67
4.3.90.0030.02011.67
4.3.80.0020.03011.67
4.3.70.0030.01811.67
4.3.60.0030.01811.67
4.3.50.0030.01711.67
4.3.40.0060.02511.67
4.3.30.0000.02311.67
4.3.20.0040.01811.67
4.3.10.0010.02111.67
4.3.00.0000.02011.67

preferences:
45.88 ms | 401 KiB | 5 Q