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+5,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.0090.00618.65
8.3.50.0130.00717.45
8.3.40.0040.01118.98
8.3.30.0070.00718.96
8.3.20.0040.00419.02
8.3.10.0060.00318.82
8.3.00.0030.00619.51
8.2.180.0130.00316.75
8.2.170.0070.00722.96
8.2.160.0080.00819.08
8.2.150.0040.00724.18
8.2.140.0090.00024.66
8.2.130.0030.01526.16
8.2.120.0040.00417.75
8.2.110.0100.00021.06
8.2.100.0000.01217.97
8.2.90.0040.00420.43
8.2.80.0050.00320.49
8.2.70.0050.00317.75
8.2.60.0040.00417.86
8.2.50.0060.00317.80
8.2.40.0080.00019.85
8.2.30.0030.00617.81
8.2.20.0000.00917.79
8.2.10.0080.00017.98
8.2.00.0040.00417.93
8.1.280.0140.00425.92
8.1.270.0000.00923.71
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0060.00322.14
8.1.230.0080.00421.03
8.1.220.0060.00317.79
8.1.210.0030.00519.03
8.1.200.0050.00317.72
8.1.190.0050.00317.36
8.1.180.0040.00418.10
8.1.170.0030.00517.72
8.1.160.0030.00519.05
8.1.150.0040.00418.84
8.1.140.0050.00317.54
8.1.130.0000.00717.64
8.1.120.0040.00417.66
8.1.110.0000.00817.64
8.1.100.0000.00717.52
8.1.90.0040.00417.53
8.1.80.0030.00517.64
8.1.70.0040.00417.45
8.1.60.0060.00317.75
8.1.50.0080.00017.73
8.1.40.0030.00617.67
8.1.30.0060.00317.91
8.1.20.0050.00317.89
8.1.10.0000.00817.72
8.1.00.0000.00817.64
8.0.300.0080.00020.07
8.0.290.0080.00017.00
8.0.280.0030.00318.68
8.0.270.0000.00717.41
8.0.260.0000.00716.93
8.0.250.0080.00017.10
8.0.240.0000.00817.10
8.0.230.0090.00017.23
8.0.220.0000.00717.10
8.0.210.0040.00417.04
8.0.200.0030.00317.13
8.0.190.0070.00017.19
8.0.180.0060.00317.08
8.0.170.0060.00316.99
8.0.160.0040.00417.11
8.0.150.0000.00917.06
8.0.140.0000.00717.07
8.0.130.0040.00313.52
8.0.120.0030.00617.12
8.0.110.0030.00617.04
8.0.100.0050.00316.96
8.0.90.0040.00417.14
8.0.80.0100.00617.08
8.0.70.0040.00417.20
8.0.60.0090.00016.92
8.0.50.0080.00017.17
8.0.30.0120.00617.48
8.0.20.0110.00817.41
8.0.10.0000.00717.14
8.0.00.0100.00817.09
7.4.330.0000.00513.22
7.4.320.0050.00216.75
7.4.300.0000.00616.71
7.4.290.0000.00916.89
7.4.280.0040.00416.88
7.4.270.0030.00316.72
7.4.260.0060.00013.52
7.4.250.0040.00416.73
7.4.240.0070.00016.66
7.4.230.0000.00716.93
7.4.220.0150.01216.80
7.4.210.0030.01216.86
7.4.200.0040.00416.74
7.4.190.0040.00416.69
7.4.160.0090.00616.67
7.4.150.0060.01216.66
7.4.140.0070.01317.86
7.4.130.0120.00616.90
7.4.120.0030.01416.88
7.4.110.0000.01816.72
7.4.100.0110.00716.72
7.4.90.0120.01216.95
7.4.80.0090.00919.39
7.4.70.0230.00016.79
7.4.60.0090.00616.66
7.4.50.0050.00016.59
7.4.40.0070.00716.89
7.4.30.0080.01216.65
7.4.00.0070.01014.74
7.3.330.0000.00613.34
7.3.320.0050.00013.34
7.3.310.0080.00016.57
7.3.300.0040.00416.37
7.3.290.0110.01316.56
7.3.280.0060.00916.45
7.3.270.0170.00716.81
7.3.260.0030.01416.54
7.3.240.0030.01316.52
7.3.230.0100.00716.62
7.3.210.0170.00016.74
7.3.200.0080.01116.78
7.3.190.0040.01216.84
7.3.180.0090.00616.41
7.3.170.0100.00516.56
7.3.160.0180.00316.56
7.3.120.0030.01015.36
7.2.330.0060.01216.68
7.2.320.0140.00717.03
7.2.310.0130.01016.85
7.2.300.0110.01116.96
7.2.290.0120.00617.05
7.2.00.0040.01119.41
7.1.100.0070.00718.39
7.1.70.0070.00317.40
7.1.60.0070.01719.30
7.1.50.0100.01317.23
7.1.00.0030.04022.27
7.0.200.0000.00816.88
7.0.140.0000.08022.09
7.0.120.0030.07322.04
7.0.60.0070.08320.03
7.0.50.0130.06317.86
7.0.40.0070.04320.04
7.0.30.0330.07720.11
7.0.20.0230.08320.13
7.0.10.0200.05020.22
7.0.00.0070.09020.14
5.6.280.0000.07721.16
5.6.210.0000.04320.62
5.6.200.0070.06318.22
5.6.190.0000.04720.57
5.6.180.0330.08020.43
5.6.170.0300.07020.50
5.6.160.0130.05020.46
5.6.150.0070.03718.18
5.6.140.0070.04018.13
5.6.130.0100.07718.08
5.6.120.0130.07321.16
5.6.110.0130.07321.00
5.6.100.0030.04321.14
5.6.90.0030.08321.09
5.6.80.0130.04720.38
5.6.70.4400.04320.51
5.5.350.0330.07020.41
5.5.340.0100.05017.99
5.5.330.0100.06020.38
5.5.320.0230.08020.13
5.5.310.0270.07720.31
5.5.300.0000.05317.87
5.5.290.0200.07017.93
5.5.280.0300.04720.91
5.5.270.0130.04320.80
5.5.260.0100.03720.83
5.5.250.0100.08020.67
5.5.240.0000.06320.20
5.4.450.0030.07319.45
5.4.440.0100.08019.11
5.4.430.0070.06719.50
5.4.420.0000.06319.50
5.4.410.0070.08019.20
5.4.400.0070.06719.12
5.4.390.0130.03319.12
5.4.380.0070.05318.78
5.4.370.0070.05319.14
5.4.360.0070.05019.18
5.4.350.0070.04319.17
5.4.340.0070.05319.12
5.4.320.0000.05719.15
5.4.310.0030.06319.12
5.4.300.0030.03718.78
5.4.290.0030.03719.11
5.4.280.0130.03719.11
5.4.270.0030.03718.79
5.4.260.0070.03318.92
5.4.250.0000.04319.15
5.4.240.0070.03319.17
5.4.230.0030.03718.99
5.4.220.0030.03719.08
5.4.210.0070.03319.11
5.4.200.0030.04319.07
5.4.190.0030.03718.91
5.4.180.0070.04019.07
5.4.170.0070.03319.14
5.4.160.0000.04019.06
5.4.150.0070.04319.16
5.4.140.0030.03316.27
5.4.130.0030.03316.32
5.4.120.0100.02716.21
5.4.110.0000.04316.23
5.4.100.0000.03716.23
5.4.90.0000.03716.28
5.4.80.0070.03016.36
5.4.70.0000.03716.64
5.4.60.0100.03316.26
5.4.50.0030.03316.23
5.4.40.0000.03716.21
5.4.30.0000.03716.36
5.4.20.0000.06016.28
5.4.10.0070.05016.39
5.4.00.0000.05015.80
5.3.290.0070.04014.70
5.3.280.0030.03714.43
5.3.270.0070.03314.58
5.3.260.0000.04314.50
5.3.250.0030.03714.55
5.3.240.0000.04014.57
5.3.230.0030.03714.64
5.3.220.0030.03714.53
5.3.210.0000.04314.54
5.3.200.0100.03014.39
5.3.190.0000.04014.51
5.3.180.0030.04314.68
5.3.170.0030.04314.51
5.3.160.0000.03714.50
5.3.150.0030.03714.51
5.3.140.0070.03714.40
5.3.130.0030.03714.49
5.3.120.0000.04014.58
5.3.110.0000.05014.50
5.3.100.0000.04713.97
5.3.90.0030.03714.00
5.3.80.0030.03713.85
5.3.70.0070.05014.00
5.3.60.0030.03713.98
5.3.50.0070.06013.89
5.3.40.0130.06313.92
5.3.30.0030.04713.75
5.3.20.0000.05313.64
5.3.10.0100.06713.51
5.3.00.0070.04313.48
5.2.170.0030.03711.32
5.2.160.0000.04311.33
5.2.150.0030.03711.11
5.2.140.0100.05710.99
5.2.130.0000.04711.12
5.2.120.0030.03311.01
5.2.110.0130.05011.28
5.2.100.0000.03711.06
5.2.90.0000.03011.09
5.2.80.0000.03710.97
5.2.70.0000.06711.04
5.2.60.0030.04011.04
5.2.50.0030.03011.19
5.2.40.0130.05310.95
5.2.30.0000.03310.98
5.2.20.0100.02310.92
5.2.10.0100.06010.86
5.2.00.0130.05010.66
5.1.60.0100.0179.98
5.1.50.0000.04710.16
5.1.40.0030.03010.04
5.1.30.0000.04010.43
5.1.20.0030.06010.44
5.1.10.0000.06010.04
5.1.00.0100.02710.00
5.0.50.0030.0408.63
5.0.40.0030.0438.48
5.0.30.0070.0508.27
5.0.20.0000.0278.20
5.0.10.0000.0278.24
5.0.00.0070.0608.26
4.4.90.0030.0207.73
4.4.80.0030.0137.73
4.4.70.0070.0337.73
4.4.60.0000.0377.73
4.4.50.0000.0407.73
4.4.40.0000.0537.73
4.4.30.0000.0277.73
4.4.20.0000.0237.73
4.4.10.0070.0307.73
4.4.00.0070.0507.73
4.3.110.0000.0277.73
4.3.100.0030.0377.73
4.3.90.0030.0377.73
4.3.80.0030.0537.73
4.3.70.0000.0307.73
4.3.60.0000.0377.73
4.3.50.0100.0277.73
4.3.40.0070.0437.73
4.3.30.0000.0207.73
4.3.20.0030.0177.73
4.3.10.0000.0377.73
4.3.00.0030.0277.73

preferences:
53.23 ms | 401 KiB | 5 Q