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 = 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 .= 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'] && !empty($p2) && $p2<$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.0120.00918.53
8.3.50.0140.00822.17
8.3.40.0140.00419.09
8.3.30.0120.00318.95
8.3.20.0030.00618.94
8.3.10.0040.00421.09
8.3.00.0040.00423.61
8.2.180.0120.00916.88
8.2.170.0140.00022.96
8.2.160.0030.01020.47
8.2.150.0070.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00419.50
8.2.110.0030.00621.11
8.2.100.0070.00418.03
8.2.90.0050.00319.22
8.2.80.0030.00518.16
8.2.70.0030.00617.75
8.2.60.0040.00417.93
8.2.50.0060.00318.07
8.2.40.0070.00318.16
8.2.30.0000.00819.92
8.2.20.0030.00617.90
8.2.10.0040.00417.91
8.2.00.0040.00417.81
8.1.280.0150.00025.92
8.1.270.0080.00023.99
8.1.260.0060.01326.35
8.1.250.0000.00828.09
8.1.240.0060.00620.76
8.1.230.0040.00720.91
8.1.220.0050.00318.77
8.1.210.0050.00318.97
8.1.200.0060.00317.47
8.1.190.0000.00819.41
8.1.180.0040.00418.10
8.1.170.0050.00318.50
8.1.160.0040.00418.95
8.1.150.0000.00818.82
8.1.140.0000.00717.55
8.1.130.0030.00317.97
8.1.120.0000.00717.53
8.1.110.0050.00317.68
8.1.100.0040.00417.67
8.1.90.0070.00017.62
8.1.80.0020.00517.61
8.1.70.0030.00317.57
8.1.60.0050.00217.75
8.1.50.0090.00017.64
8.1.40.0070.00317.76
8.1.30.0040.00417.82
8.1.20.0060.00317.82
8.1.10.0030.00617.70
8.1.00.0070.00417.68
8.0.300.0040.00420.15
8.0.290.0000.00717.30
8.0.280.0000.00718.49
8.0.270.0000.00817.24
8.0.260.0000.00717.00
8.0.250.0070.00017.09
8.0.240.0000.00817.09
8.0.230.0030.00317.18
8.0.220.0000.00717.06
8.0.210.0030.00317.05
8.0.200.0000.00717.11
8.0.190.0030.00617.00
8.0.180.0080.00017.01
8.0.170.0000.00717.07
8.0.160.0050.00217.05
8.0.150.0000.00916.88
8.0.140.0050.00217.09
8.0.130.0060.00013.49
8.0.120.0040.00417.01
8.0.110.0030.00617.04
8.0.100.0050.00317.07
8.0.90.0050.00317.13
8.0.80.0070.01017.08
8.0.70.0000.00716.93
8.0.60.0040.00416.97
8.0.50.0040.00417.18
8.0.30.0100.00917.33
8.0.20.0140.00617.50
8.0.10.0000.00717.25
8.0.00.0130.00817.13
7.4.330.0030.00314.89
7.4.320.0000.00716.73
7.4.300.0030.00316.75
7.4.290.0000.00716.75
7.4.280.0040.00816.85
7.4.270.0030.00316.75
7.4.260.0060.00013.53
7.4.250.0030.00516.70
7.4.240.0080.00016.87
7.4.230.0080.00016.87
7.4.220.0070.01016.75
7.4.210.0080.00716.84
7.4.200.0000.00716.66
7.4.190.0080.00016.91
7.4.160.0160.00016.51
7.4.150.0120.00617.40
7.4.140.0110.01317.86
7.4.130.0120.00916.66
7.4.120.0070.01116.66
7.4.110.0120.00616.80
7.4.100.0150.00316.87
7.4.90.0130.00816.60
7.4.80.0130.00319.37
7.4.70.0130.01016.65
7.4.60.0100.01016.62
7.4.50.0070.00016.61
7.4.40.0100.00322.27
7.4.30.0120.01216.83
7.4.00.0060.00915.26
7.3.330.0000.00513.21
7.3.320.0030.00313.36
7.3.310.0050.00316.46
7.3.300.0030.00316.41
7.3.290.0150.00016.53
7.3.280.0110.00716.48
7.3.270.0090.00917.40
7.3.260.0080.01018.24
7.3.250.0100.00816.69
7.3.240.0030.01316.73
7.3.230.0060.01116.81
7.3.210.0120.00616.85
7.3.200.0060.01019.39
7.3.190.0080.00816.61
7.3.180.0100.00716.79
7.3.170.0090.01216.72
7.3.160.0060.01016.68
7.3.120.0090.00915.00
7.3.110.0110.01114.98
7.3.100.0000.01115.21
7.3.90.0040.00715.02
7.3.80.0120.00015.19
7.3.70.0110.00315.17
7.3.60.0150.00415.03
7.3.50.0060.00915.05
7.3.40.0090.00315.13
7.3.30.0070.00714.63
7.3.20.0070.01316.83
7.3.10.0130.00616.86
7.3.00.0090.00616.84
7.2.330.0120.00617.04
7.2.320.0130.00916.91
7.2.310.0090.00916.92
7.2.300.0100.00717.03
7.2.290.0080.01216.67
7.2.250.0070.01515.25
7.2.240.0030.01715.50
7.2.230.0000.00915.28
7.2.220.0030.01415.04
7.2.210.0000.01615.23
7.2.200.0030.01315.42
7.2.190.0030.00615.33
7.2.180.0070.01115.23
7.2.170.0060.00915.30
7.2.160.0040.01115.54
7.2.150.0130.00317.17
7.2.140.0040.01417.23
7.2.130.0080.00417.08
7.2.120.0090.00917.17
7.2.110.0030.01317.13
7.2.100.0090.00917.09
7.2.90.0190.00016.91
7.2.80.0000.01816.88
7.2.70.0070.01117.13
7.2.60.0060.01216.86
7.2.50.0090.00917.02
7.2.40.0040.01116.80
7.2.30.0120.00617.17
7.2.20.0000.01617.31
7.2.10.0110.00617.14
7.2.00.0040.00818.54
7.1.330.0070.00715.82
7.1.320.0090.00616.00
7.1.310.0070.00715.97
7.1.300.0100.00716.11
7.1.290.0070.00716.06
7.1.280.0100.00315.73
7.1.270.0000.01516.16
7.1.260.0070.00316.22
7.1.250.0060.00915.98
7.1.100.0000.01318.17
7.1.70.0100.00717.45
7.1.60.0070.01819.40
7.1.50.0100.01316.90
7.1.00.0100.06322.38
7.0.200.0000.00816.92
7.0.140.0030.07321.92
7.0.60.0100.04319.89
7.0.50.0100.05717.86
7.0.40.0100.07720.09
7.0.30.0230.06020.06
7.0.20.0370.07020.02
7.0.10.0130.08020.20
7.0.00.0130.08320.19
5.6.280.0070.06721.11
5.6.210.0070.08020.70
5.6.200.0000.06318.11
5.6.190.0030.04720.57
5.6.180.0230.04320.35
5.6.170.0270.04020.61
5.6.160.0030.05020.47
5.6.150.0100.05318.15
5.6.140.0130.04718.18
5.6.130.0000.08718.20
5.6.120.0130.07720.99
5.6.110.0130.04721.10
5.6.100.0030.04720.98
5.6.90.0000.04321.13
5.6.80.0300.06320.38
5.5.350.2830.03720.40
5.5.340.0000.05717.89
5.5.330.0070.04020.40
5.5.320.0370.05720.20
5.5.310.0170.04720.41
5.5.300.0030.04717.97
5.5.290.0070.07017.88
5.5.280.0170.04720.89
5.5.270.0170.06720.69
5.5.260.0130.07720.69
5.5.250.0130.04320.71
5.5.240.0170.06020.18
5.4.450.0200.04019.38
5.4.440.0230.05319.46
5.4.430.0170.05019.22
5.4.420.0270.04319.48
5.4.410.0100.05319.32
5.4.400.0270.06318.95
5.4.390.0270.07319.24
5.4.380.0270.05718.80
5.4.370.0270.06719.22
5.4.360.0300.05719.24
5.4.350.0130.05318.80
5.4.340.0270.06719.27
5.4.320.0300.06719.23
5.4.310.0200.03719.24
5.4.300.0200.03319.13
5.4.290.0170.03719.21
5.4.280.0130.04019.13
5.4.270.0230.03319.07
5.4.260.0200.03319.08
5.4.250.0200.03319.08
5.4.240.0230.03018.80
5.4.230.0270.02718.91
5.4.220.0130.04018.93
5.4.210.0130.05019.09
5.4.200.0200.03019.13
5.4.190.0200.04319.21
5.4.180.0170.04318.84
5.4.170.0170.03719.06
5.4.160.0130.04019.06
5.4.150.0200.03319.22
5.4.140.0170.03316.46
5.4.130.0200.03016.54
5.4.120.0170.03316.29
5.4.110.0300.03716.07
5.4.100.0170.03316.43
5.4.90.0170.03716.46
5.4.80.0200.03016.38
5.4.70.0230.02716.50
5.4.60.0130.03716.39
5.4.50.0200.05316.46
5.4.40.0130.03716.47
5.4.30.0270.06016.45
5.4.20.0230.07316.38
5.4.10.0100.04316.45
5.4.00.0270.04015.70
5.3.290.0230.05714.53
5.3.280.0100.04314.45
5.3.270.0130.04314.56
5.3.260.0100.04314.71
5.3.250.0170.04014.46
5.3.240.0170.03314.68
5.3.230.0100.04314.49
5.3.220.0200.03314.46
5.3.210.0170.04314.45
5.3.200.0200.03714.44
5.3.190.0230.04714.62
5.3.180.0130.03714.42
5.3.170.0170.03714.56
5.3.160.0170.03314.68
5.3.150.0300.02314.55
5.3.140.0300.03014.66
5.3.130.0270.03014.44
5.3.120.0300.06714.52
5.3.110.0230.05714.50
5.3.100.0270.04314.00
5.3.90.0300.06313.99
5.3.80.0270.06013.98
5.3.70.0200.06313.85
5.3.60.0230.06713.97
5.3.50.0200.07713.99
5.3.40.0200.05313.87
5.3.30.0230.04013.91
5.3.20.0270.04313.76
5.3.10.0230.07313.62
5.3.00.0330.06713.51
5.2.170.0270.05311.01
5.2.160.0270.05711.11
5.2.150.0300.05011.32
5.2.140.0270.03311.23
5.2.130.0200.06310.97
5.2.120.0230.05711.04
5.2.110.0200.05311.14
5.2.100.0200.02711.06
5.2.90.0270.05011.14
5.2.80.0200.02711.01
5.2.70.0200.02710.97
5.2.60.0230.05711.22
5.2.50.0200.06011.05
5.2.40.0200.06010.96
5.2.30.0130.04310.88
5.2.20.0100.04310.85
5.2.10.0230.05310.98
5.2.00.0270.04710.74
5.1.60.0200.02310.11
5.1.50.0130.02710.11
5.1.40.0130.02310.11
5.1.30.0130.02710.50
5.1.20.0230.02010.59
5.1.10.0170.02310.24
5.1.00.0170.04710.11
5.0.50.0170.02010.11
5.0.40.0100.02310.11
5.0.30.0100.03010.11
5.0.20.0170.03710.11
5.0.10.0130.02710.11
5.0.00.0100.06710.11
4.4.90.0130.03310.11
4.4.80.0170.02710.11
4.4.70.0070.03710.11
4.4.60.0070.03310.11
4.4.50.0130.03010.11
4.4.40.0070.05010.11
4.4.30.0070.01710.11
4.4.20.0030.01710.11
4.4.10.0100.01710.11
4.4.00.0100.05310.11
4.3.110.0130.03310.11
4.3.100.0100.03710.11
4.3.90.0130.02010.11
4.3.80.0130.04010.11
4.3.70.0100.01710.11
4.3.60.0130.03010.11
4.3.50.0100.03010.11
4.3.40.0130.04710.11
4.3.30.0030.02310.11
4.3.20.0100.03310.11
4.3.10.0100.03010.11
4.3.00.0030.03710.11

preferences:
50.11 ms | 400 KiB | 5 Q