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 . 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.0090.00618.52
8.3.50.0120.00722.17
8.3.40.0130.00618.91
8.3.30.0120.00319.03
8.3.20.0110.00418.85
8.3.10.0120.00321.22
8.3.00.0080.00021.90
8.2.180.0080.00816.63
8.2.170.0120.00322.96
8.2.160.0100.00320.44
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.01126.16
8.2.120.0040.00421.14
8.2.110.0050.00521.23
8.2.100.0110.00018.13
8.2.90.0000.00818.00
8.2.80.0070.00317.97
8.2.70.0040.00418.03
8.2.60.0050.00518.14
8.2.50.0030.00518.10
8.2.40.0030.00619.38
8.2.30.0030.00719.43
8.2.20.0080.00017.99
8.2.10.0040.00417.82
8.2.00.0030.00717.89
8.1.280.0060.01225.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00720.96
8.1.230.0070.00417.77
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0050.00517.60
8.1.190.0060.00317.36
8.1.180.0000.00818.10
8.1.170.0000.00818.69
8.1.160.0000.00818.95
8.1.150.0030.00518.94
8.1.140.0050.00317.57
8.1.130.0030.00317.79
8.1.120.0040.00417.50
8.1.110.0040.00417.61
8.1.100.0000.00717.62
8.1.90.0000.00717.52
8.1.80.0040.00417.71
8.1.70.0030.00317.55
8.1.60.0030.00717.77
8.1.50.0000.00717.77
8.1.40.0080.00017.79
8.1.30.0060.00317.89
8.1.20.0080.00017.89
8.1.10.0080.00017.80
8.1.00.0040.00417.76
8.0.300.0070.00318.77
8.0.290.0060.00317.13
8.0.280.0030.00318.55
8.0.270.0040.00417.37
8.0.260.0040.00417.16
8.0.250.0080.00017.13
8.0.240.0060.00317.10
8.0.230.0000.00717.18
8.0.220.0000.00717.04
8.0.210.0000.00717.09
8.0.200.0030.00317.25
8.0.190.0000.00717.26
8.0.180.0030.00517.04
8.0.170.0080.00017.21
8.0.160.0040.00317.11
8.0.150.0080.00017.07
8.0.140.0040.00417.07
8.0.130.0060.00313.55
8.0.120.0080.00017.09
8.0.110.0040.00416.99
8.0.100.0080.00017.14
8.0.90.0070.00017.18
8.0.80.0090.00617.12
8.0.70.0000.00717.15
8.0.60.0040.00417.19
8.0.50.0080.00017.09
8.0.30.0100.01217.46
8.0.20.0120.00617.53
8.0.10.0040.00417.07
8.0.00.0120.00817.09
7.4.330.0050.00016.70
7.4.320.0060.00016.75
7.4.300.0000.00616.89
7.4.290.0030.00316.75
7.4.280.0060.00316.71
7.4.270.0030.00316.73
7.4.260.0050.00013.56
7.4.250.0000.00816.79
7.4.240.0000.00816.73
7.4.230.0000.00716.86
7.4.220.0110.00716.73
7.4.210.0040.01116.78
7.4.200.0080.00016.94
7.4.190.0040.00416.84
7.4.160.0070.01016.91
7.4.150.0090.00917.40
7.4.140.0090.00817.86
7.4.130.0060.01116.63
7.4.120.0100.00716.75
7.4.110.0130.00916.71
7.4.100.0080.01516.78
7.4.90.0090.00916.80
7.4.80.0130.01019.39
7.4.70.0090.00916.37
7.4.60.0130.00416.85
7.4.50.0050.00016.77
7.4.40.0040.00822.77
7.4.30.0100.00616.57
7.4.00.0030.01415.29
7.3.330.0000.00613.34
7.3.320.0120.00013.35
7.3.310.0000.00716.45
7.3.300.0030.00516.51
7.3.290.0000.01416.50
7.3.280.0100.00716.50
7.3.270.0110.00617.40
7.3.260.0110.00718.24
7.3.250.0170.00716.64
7.3.240.0030.01416.55
7.3.230.0130.00516.54
7.3.210.0000.01616.76
7.3.200.0160.00319.39
7.3.190.0140.00516.59
7.3.180.0060.01516.73
7.3.170.0100.00616.54
7.3.160.0060.00916.40
7.3.120.0030.01315.25
7.2.330.0090.00916.82
7.2.320.0080.00916.91
7.2.310.0070.01116.89
7.2.300.0150.00317.04
7.2.290.0030.01316.90
7.2.00.0000.01519.90
7.1.100.0000.01518.11
7.1.70.0000.01017.40
7.1.60.0080.00317.50
7.1.50.0030.01417.25
7.1.00.0000.05722.53
7.0.200.0030.01316.84
7.0.140.0070.07321.95
7.0.110.0500.08720.12
7.0.100.0430.06719.98
7.0.90.0370.04720.11
7.0.80.0670.05020.06
7.0.70.0100.06719.87
7.0.60.0330.04020.06
7.0.50.0000.04319.96
7.0.40.0030.03319.68
7.0.30.0070.04719.72
7.0.20.0130.07719.84
7.0.10.0070.08019.73
7.0.00.0170.06719.65
5.6.280.0000.07721.05
5.6.260.0030.03320.63
5.6.250.0000.04320.89
5.6.240.0030.03720.70
5.6.230.0100.07320.71
5.6.220.0030.08720.72
5.6.210.0130.06320.40
5.6.200.0100.04020.64
5.6.190.0030.04720.86
5.6.180.0130.04320.66
5.6.170.0030.03720.70
5.6.160.0030.03720.46
5.6.150.0030.03720.66
5.6.140.0100.05020.72
5.6.130.0070.03720.52
5.6.120.0070.03020.71
5.6.110.0070.03020.57
5.6.100.0000.04320.70
5.6.90.0100.06720.56
5.6.80.0070.03319.94
5.6.70.0070.07719.95
5.6.60.0100.05319.95
5.6.50.0030.06019.98
5.6.40.0000.04020.03
5.6.30.0030.07320.01
5.6.20.0030.07319.91
5.6.10.0130.06319.99
5.6.00.0030.03319.92
5.5.380.0000.04317.57
5.5.370.0100.07317.48
5.5.360.0100.06317.52
5.5.350.0000.04317.63
5.5.340.0000.04318.14
5.5.330.0030.04018.16
5.5.320.0030.04017.77
5.5.310.0100.03318.27
5.5.300.0000.04318.15
5.5.290.0000.04318.16
5.5.280.0070.03017.84
5.5.270.0000.03718.00
5.5.260.0070.04718.09
5.5.250.0030.07317.69
5.5.240.0070.06317.39
5.5.230.0130.03017.14
5.5.220.0100.07317.24
5.5.210.0070.05717.50
5.5.200.0000.07717.48
5.5.190.0030.04717.38
5.5.180.0000.04017.24
5.5.160.0000.07317.21
5.5.150.0000.03717.35
5.5.140.0130.02317.33
5.5.130.0070.06317.11
5.5.120.0070.06017.44
5.5.110.0030.03717.50
5.5.100.0000.04017.28
5.5.90.0070.04017.41
5.5.80.0030.03717.10
5.5.70.0130.06016.97
5.5.60.0000.05717.09
5.5.50.0070.04017.36
5.5.40.0070.03317.51
5.5.30.0070.07016.99
5.5.20.0170.06317.00
5.5.10.0030.03717.27
5.5.00.0130.07017.33
5.4.450.0030.04019.43
5.4.440.0000.03719.55
5.4.430.0070.03019.34
5.4.420.0070.03719.29
5.4.410.0070.04019.43
5.4.400.0030.06319.00
5.4.390.0130.05018.99
5.4.380.0070.03319.27
5.4.370.0000.04319.00
5.4.360.0070.05719.18
5.4.350.0030.07019.26
5.4.340.0100.05019.11
5.4.320.0070.07319.07
5.4.310.0030.04718.93
5.4.300.0130.06318.93
5.4.290.0070.07719.11
5.4.280.0000.07018.99
5.4.270.0130.05319.08
5.4.260.0070.03318.99
5.4.250.0000.04018.92
5.4.240.0030.06718.92
5.4.230.0030.05719.07
5.4.220.0000.08019.17
5.4.210.0070.07319.02
5.4.200.0070.07319.09
5.4.190.0030.03718.99
5.4.180.0000.07719.07
5.4.170.0000.07319.09
5.4.160.0070.07719.00
5.4.150.0070.05318.95
5.4.140.0030.04016.34
5.4.130.0030.04016.22
5.4.120.0070.06316.21
5.4.110.0100.05716.29
5.4.100.0030.07016.52
5.4.90.0130.06316.37
5.4.80.0000.04316.45
5.4.70.0030.07316.47
5.4.60.0030.04716.20
5.4.50.0030.06316.26
5.4.40.0030.04716.48
5.4.30.0000.03716.46
5.4.20.0070.03016.35
5.4.10.0070.08016.44
5.4.00.0000.03715.92
5.3.290.0030.05714.71
5.3.280.0070.07314.68
5.3.270.0030.07314.71
5.3.260.0130.06714.52
5.3.250.0100.06314.70
5.3.240.0030.07314.57
5.3.230.0100.06714.61
5.3.220.0070.07314.69
5.3.210.0030.07714.53
5.3.200.0000.04714.60
5.3.190.0000.07714.66
5.3.180.0070.04314.48
5.3.170.0070.07314.52
5.3.160.0070.06714.39
5.3.150.0100.07314.66
5.3.140.0030.03714.66
5.3.130.0070.06714.46
5.3.120.0130.06714.52
5.3.110.0070.07014.43
5.3.100.0070.03313.98
5.3.90.0070.03014.14
5.3.80.0070.06313.96
5.3.70.0030.07713.91
5.3.60.0030.05313.95
5.3.50.0070.05713.79
5.3.40.0030.04313.98
5.3.30.0130.06313.75
5.3.20.0070.06713.50
5.3.10.0070.05713.50
5.3.00.0000.08713.44
5.2.170.0070.06011.95
5.2.160.0070.03011.95
5.2.150.0000.06311.95
5.2.140.0030.06311.95
5.2.130.0070.04311.95
5.2.120.0070.03011.95
5.2.110.0070.02711.95
5.2.100.0000.06311.95
5.2.90.0030.06011.95
5.2.80.0070.04311.95
5.2.70.0030.03311.95
5.2.60.0100.05711.95
5.2.50.0000.03311.95
5.2.40.0000.03011.95
5.2.30.0030.02711.95
5.2.20.0000.03311.95
5.2.10.0000.02711.95
5.2.00.0070.02311.95
5.1.60.0000.02711.95
5.1.50.0000.02711.95
5.1.40.0030.02711.95
5.1.30.0030.02311.95
5.1.20.0000.02711.95
5.1.10.0000.03011.95
5.1.00.0030.03311.95
5.0.50.0000.02011.95
5.0.40.0000.02011.95
5.0.30.0000.03311.95
5.0.20.0000.02011.95
5.0.10.0070.03711.95
5.0.00.0030.05011.95
4.4.90.0000.03311.95
4.4.80.0000.01311.95
4.4.70.0000.01711.95
4.4.60.0030.01011.95
4.4.50.0000.01311.95
4.4.40.0030.02011.95
4.4.30.0000.01311.95
4.4.20.0030.01011.95
4.4.10.0000.01711.95
4.4.00.0030.02311.95
4.3.110.0030.01311.95
4.3.100.0000.01711.95
4.3.90.0000.01711.95
4.3.80.0000.05711.95
4.3.70.0000.03011.95
4.3.60.0070.02711.95
4.3.50.0030.01311.95
4.3.40.0000.03711.95
4.3.30.0000.03711.95
4.3.20.0030.02011.95
4.3.10.0030.01711.95
4.3.00.0000.01711.95

preferences:
47.89 ms | 400 KiB | 5 Q