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, '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.0140.00418.56
8.3.50.0090.00822.03
8.3.40.0160.00019.24
8.3.30.0090.00619.22
8.3.20.0000.00820.29
8.3.10.0050.00323.70
8.3.00.0080.00022.37
8.2.180.0030.01217.00
8.2.170.0120.00822.96
8.2.160.0070.00722.43
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00417.88
8.2.110.0030.00622.43
8.2.100.0060.00618.03
8.2.90.0030.00519.17
8.2.80.0030.00618.02
8.2.70.0040.00717.75
8.2.60.0030.00717.93
8.2.50.0090.00018.07
8.2.40.0060.00318.34
8.2.30.0050.00218.25
8.2.20.0000.00717.95
8.2.10.0000.00818.05
8.2.00.0080.00017.89
8.1.280.0080.00825.92
8.1.270.0030.00523.97
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.90
8.1.230.0080.00419.09
8.1.220.0050.00317.79
8.1.210.0040.00418.77
8.1.200.0090.00017.48
8.1.190.0030.00517.53
8.1.180.0000.00918.10
8.1.170.0040.00418.63
8.1.160.0000.00722.07
8.1.150.0080.00018.86
8.1.140.0040.00417.57
8.1.130.0030.00317.95
8.1.120.0040.00417.69
8.1.110.0080.00017.63
8.1.100.0000.00717.52
8.1.90.0080.00017.66
8.1.80.0000.00717.63
8.1.70.0000.00717.54
8.1.60.0000.00817.85
8.1.50.0000.00817.79
8.1.40.0050.00317.69
8.1.30.0080.00017.85
8.1.20.0030.00617.96
8.1.10.0000.00817.84
8.1.00.0060.00317.72
8.0.300.0040.00418.77
8.0.290.0070.00017.30
8.0.280.0040.00418.60
8.0.270.0030.00317.43
8.0.260.0030.00317.12
8.0.250.0000.00717.25
8.0.240.0040.00417.26
8.0.230.0030.00317.13
8.0.220.0030.00317.09
8.0.210.0000.00717.21
8.0.200.0000.00717.28
8.0.190.0090.00017.14
8.0.180.0000.00717.22
8.0.170.0000.00817.22
8.0.160.0080.00017.09
8.0.150.0000.00717.10
8.0.140.0030.00617.17
8.0.130.0080.00013.61
8.0.120.0080.00017.14
8.0.110.0000.00717.18
8.0.100.0000.00717.06
8.0.90.0040.00417.08
8.0.80.0070.01417.14
8.0.70.0040.00417.23
8.0.60.0000.00717.23
8.0.50.0050.00217.23
8.0.30.0100.01317.23
8.0.20.0130.00617.40
8.0.10.0040.00417.26
8.0.00.0100.01016.92
7.4.330.0050.00015.14
7.4.320.0000.00616.84
7.4.300.0060.00016.73
7.4.290.0000.00716.67
7.4.280.0000.00716.72
7.4.270.0000.00716.74
7.4.260.0000.00716.88
7.4.250.0040.00416.83
7.4.240.0060.00216.81
7.4.230.0000.00716.82
7.4.220.0150.01216.80
7.4.210.0040.01516.84
7.4.200.0070.00016.82
7.4.190.0000.00816.98
7.4.160.0080.00816.80
7.4.150.0070.01017.40
7.4.140.0120.00517.86
7.4.130.0100.00816.74
7.4.120.0080.00916.86
7.4.110.0150.00716.63
7.4.100.0060.01616.84
7.4.90.0120.00616.73
7.4.80.0110.00816.62
7.4.70.0110.00716.93
7.4.60.0170.00416.82
7.4.50.0040.00416.81
7.4.40.0080.00822.77
7.4.30.0090.01216.83
7.4.10.0100.00315.11
7.4.00.0070.00915.18
7.3.330.0050.00013.40
7.3.320.0000.00613.49
7.3.310.0070.00016.42
7.3.300.0000.00716.59
7.3.290.0000.01416.54
7.3.280.0060.01216.63
7.3.270.0120.00617.40
7.3.260.0060.01116.70
7.3.250.0130.00416.73
7.3.240.0170.00316.80
7.3.230.0100.00716.57
7.3.210.0120.00616.62
7.3.200.0070.01419.39
7.3.190.0100.01316.50
7.3.180.0130.00316.79
7.3.170.0150.00016.54
7.3.160.0090.00716.72
7.3.130.0100.01014.76
7.3.120.0090.00915.15
7.3.110.0070.00915.04
7.3.100.0080.00815.14
7.3.90.0060.00515.21
7.3.80.0080.00615.12
7.3.70.0050.00515.13
7.3.60.0080.00515.18
7.3.50.0100.00315.14
7.3.40.0070.01015.09
7.3.30.0060.00515.05
7.3.20.0020.01016.83
7.3.10.0040.00916.76
7.3.00.0090.00616.75
7.2.330.0170.00016.89
7.2.320.0230.00316.91
7.2.310.0100.00716.88
7.2.300.0100.00616.83
7.2.290.0080.01216.82
7.2.260.0040.01715.33
7.2.250.0030.01215.55
7.2.240.0070.01015.29
7.2.230.0020.01215.26
7.2.220.0040.01215.15
7.2.210.0040.00915.22
7.2.200.0030.00815.39
7.2.190.0070.00615.47
7.2.180.0090.00915.31
7.2.170.0050.00915.34
7.2.160.0030.00915.39
7.2.150.0030.00817.02
7.2.140.0060.00617.00
7.2.130.0090.00717.01
7.2.120.0090.00816.99
7.2.110.0090.00716.96
7.2.100.0090.01017.15
7.2.90.0070.01017.10
7.2.80.0100.00817.00
7.2.70.0080.00917.12
7.2.60.0110.00517.01
7.2.50.0060.01117.09
7.2.40.0070.01017.00
7.2.30.0080.00816.98
7.2.20.0100.00617.01
7.2.10.0070.00916.98
7.2.00.0080.00817.68
7.1.330.0030.01316.22
7.1.320.0090.00315.89
7.1.310.0060.00616.14
7.1.300.0050.00915.98
7.1.290.0030.00815.99
7.1.280.0000.01415.83
7.1.270.0070.00715.96
7.1.260.0040.00916.12
7.1.250.0110.00616.04
7.1.240.0030.01115.98
7.1.230.0080.00516.14
7.1.220.0030.01215.98
7.1.210.0080.00615.86
7.1.200.0050.00816.01
7.1.190.0050.00716.05
7.1.180.0050.00516.01
7.1.170.0040.00715.91
7.1.160.0050.00616.04
7.1.150.0050.00716.10
7.1.140.0080.00616.13
7.1.130.0070.00415.86
7.1.120.0040.00916.04
7.1.110.0050.00616.10
7.1.100.0030.01216.86
7.1.90.0070.01216.04
7.1.80.0050.01015.95
7.1.70.0050.00716.41
7.1.60.0080.00817.10
7.1.50.0030.01016.31
7.1.40.0050.01115.95
7.1.30.0060.00915.93
7.1.20.0030.01015.93
7.1.10.0050.00815.91
7.1.00.0080.02818.21
7.0.330.0030.00815.58
7.0.320.0070.01115.67
7.0.310.0050.00615.61
7.0.300.0050.00815.54
7.0.290.0080.00415.38
7.0.280.0090.00315.58
7.0.270.0030.00915.58
7.0.260.0040.01115.64
7.0.250.0110.00315.66
7.0.240.0020.01115.64
7.0.230.0050.00715.75
7.0.220.0070.00615.43
7.0.210.0070.00615.62
7.0.200.0070.00716.11
7.0.190.0080.00515.45
7.0.180.0050.00915.61
7.0.170.0050.00915.57
7.0.160.0030.01315.40
7.0.150.0020.01315.73
7.0.140.0050.03017.60
7.0.130.0040.00915.46
7.0.120.0070.00515.62
7.0.110.0040.00715.72
7.0.100.0120.02717.12
7.0.90.0050.03617.05
7.0.80.0050.03317.08
7.0.70.0070.03016.93
7.0.60.0040.03016.97
7.0.50.0060.03017.75
7.0.40.0060.02715.84
7.0.30.0040.03515.83
7.0.20.0040.03715.78
7.0.10.0090.02615.92
7.0.00.0030.02915.78
5.6.400.0000.01014.55
5.6.390.0110.00314.63
5.6.380.0050.01114.66
5.6.370.0030.00914.47
5.6.360.0050.00514.74
5.6.350.0030.01014.38
5.6.340.0020.01414.48
5.6.330.0050.01114.75
5.6.320.0100.00614.70
5.6.310.0060.00614.47
5.6.300.0060.00814.72
5.6.290.0060.00714.63
5.6.280.0060.02816.53
5.6.270.0050.00814.41
5.6.260.0110.00014.54
5.6.250.0100.02716.65
5.6.240.0090.03216.61
5.6.230.0060.03316.77
5.6.220.0060.02816.66
5.6.210.0060.03516.47
5.6.200.0030.03716.82
5.6.190.0110.02816.81
5.6.180.0070.03016.60
5.6.170.0090.02916.74
5.6.160.0070.03016.68
5.6.150.0030.03616.61
5.6.140.0040.03716.61
5.6.130.0060.03016.66
5.6.120.0040.03416.71
5.6.110.0070.02116.71
5.6.100.0070.03316.69
5.6.90.0020.03516.63
5.6.80.0070.03116.45
5.6.70.0050.03116.34
5.6.60.0040.03316.35
5.6.50.0080.02816.48
5.6.40.0040.02916.47
5.6.30.0080.03016.46
5.6.20.0050.02816.44
5.6.10.0030.03216.36
5.6.00.0070.03016.47
5.5.380.0070.02616.47
5.5.370.0050.03316.61
5.5.360.0060.02116.45
5.5.350.0030.03016.70
5.5.340.0060.02916.57
5.5.330.0050.02116.58
5.5.320.0060.02916.68
5.5.310.0070.03416.74
5.5.300.0050.02616.76
5.5.290.0060.03316.70
5.5.280.0040.03316.52
5.5.270.0070.03116.51
5.5.260.0050.03416.80
5.5.250.0080.03116.48
5.5.240.0080.03016.48
5.5.230.0070.03016.37
5.5.220.0070.02816.40
5.5.210.0090.02916.52
5.5.200.0050.03416.50
5.5.190.0040.03316.43
5.5.180.0090.02716.45
5.5.170.0050.00814.35
5.5.160.0060.03016.46
5.5.150.0070.02816.38
5.5.140.0040.02116.52
5.5.130.0070.02916.31
5.5.120.0070.03316.36
5.5.110.0060.03116.40
5.5.100.0060.02716.37
5.5.90.0070.02916.38
5.5.80.0070.02816.36
5.5.70.0020.03416.25
5.5.60.0040.02116.39
5.5.50.0100.02616.39
5.5.40.0050.03516.29
5.5.30.0040.03216.30
5.5.20.0070.02916.41
5.5.10.0090.02516.33
5.5.00.0050.03316.27
5.4.450.0050.02314.05
5.4.440.0030.02613.94
5.4.430.0030.02514.06
5.4.420.0070.02613.90
5.4.410.0090.02313.90
5.4.400.0030.03213.68
5.4.390.0060.02913.84
5.4.380.0090.02013.83
5.4.370.0080.02713.77
5.4.360.0030.02913.93
5.4.350.0020.02913.93
5.4.340.0030.03213.84
5.4.330.0050.00311.16
5.4.320.0030.03013.90
5.4.310.0050.01713.76
5.4.300.0070.02313.69
5.4.290.0100.02213.77
5.4.280.0090.01813.73
5.4.270.0030.01913.61
5.4.260.0060.02713.78
5.4.250.0080.02413.87
5.4.240.0040.02713.87
5.4.230.0020.03113.79
5.4.220.0030.02913.76
5.4.210.0070.03013.83
5.4.200.0050.02813.84
5.4.190.0040.02113.84
5.4.180.0020.03413.77
5.4.170.0060.02513.75
5.4.160.0050.03313.91
5.4.150.0040.03513.81
5.4.140.0080.02413.00
5.4.130.0020.02912.94
5.4.120.0020.03012.91
5.4.110.0070.02712.84
5.4.100.0060.02913.00
5.4.90.0060.01812.85
5.4.80.0070.02212.72
5.4.70.0050.02912.91
5.4.60.0080.02512.94
5.4.50.0040.03012.97
5.4.40.0080.02712.88
5.4.30.0060.02512.84
5.4.20.0010.03312.90
5.4.10.0060.02512.83
5.4.00.0080.02712.67
5.3.290.0080.02612.02
5.3.280.0050.02811.87
5.3.270.0080.02711.95
5.3.260.0100.02811.94
5.3.250.0060.02911.99
5.3.240.0010.02811.92
5.3.230.0030.03111.91
5.3.220.0050.03011.98
5.3.210.0060.02911.99
5.3.200.0080.02711.91
5.3.190.0100.02712.00
5.3.180.0040.02912.04
5.3.170.0050.02511.91
5.3.160.0070.02912.00
5.3.150.0030.02311.94
5.3.140.0040.02911.98
5.3.130.0020.02811.98
5.3.120.0040.02912.00
5.3.110.0070.02411.94
5.3.100.0050.03011.79
5.3.90.0030.01911.67
5.3.80.0030.03011.61
5.3.70.0060.02711.71
5.3.60.0050.02711.77
5.3.50.0020.02711.59
5.3.40.0060.02211.59
5.3.30.0040.03011.54
5.3.20.0050.02811.56
5.3.10.0090.02411.41
5.3.00.0060.02611.42
5.2.170.0070.06011.16
5.2.160.0030.06711.01
5.2.150.0070.06011.03
5.2.140.0070.03311.16
5.2.130.0070.06010.99
5.2.120.0030.06011.04
5.2.110.0070.06710.97
5.2.100.0070.06011.12
5.2.90.0070.05710.97
5.2.80.0030.07010.96
5.2.70.0130.05010.91
5.2.60.0070.05710.99
5.2.50.0030.06011.04
5.2.40.0070.05711.02
5.2.30.0070.06310.82
5.2.20.0100.05311.05
5.2.10.0100.05710.90
5.2.00.0030.06010.80
5.1.60.0000.05710.02
5.1.50.0070.05310.04
5.1.40.0170.04010.06
5.1.30.0070.05710.33
5.1.20.0030.05710.36
5.1.10.0070.05310.13
5.1.00.0100.04710.16
5.0.50.0000.0478.64
5.0.40.0070.0308.51
5.0.30.0030.0638.35
5.0.20.0070.0408.31
5.0.10.0070.0438.27
5.0.00.0070.0578.18
4.4.90.0030.0377.87
4.4.80.0070.0307.87
4.4.70.0030.0237.87
4.4.60.0070.0337.87
4.4.50.0070.0307.87
4.4.40.0000.0577.87
4.4.30.0030.0337.87
4.4.20.0030.0377.87
4.4.10.0070.0307.87
4.4.00.0030.0507.87
4.3.110.0030.0337.87
4.3.100.0000.0407.87
4.3.90.0030.0307.87
4.3.80.0030.0537.87
4.3.70.0000.0377.87
4.3.60.0030.0337.87
4.3.50.0070.0337.87
4.3.40.0000.0477.87
4.3.30.0030.0337.87
4.3.20.0070.0337.87
4.3.10.0000.0377.87
4.3.00.0000.0337.87

preferences:
47.77 ms | 401 KiB | 5 Q