3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DAL { function getNoAnnonces() { return array( "12334", "233455" ); } function getURLRecherches() { //$line = "Nissan, Rogue, 2008, 1000, 9000, 10000, 110000"; //$line2 = "Nissan, Rogue, 2009, 1000, 9000, 10000, 90000"; return array( "http://www.kijiji.ca/b-autos-camions/grand-montreal/suv+vgm-bmw-x5-2001__2009/c174l80002a138a54a1000054a68?sort=priceAsc&price=2000.00__40000.00&kilometres=10000__110000", "http://www.kijiji.ca/b-autos-camions/grand-montreal/suv+vgm-bmw-x5-2001__2009/c174l80002a138a54a1000054a68?sort=priceAsc&price=2000.00__40000.00&kilometres=10000__110000" //split(",", $line, 7), //split(",", $line2, 7) ); } } class AdsListExtractor { private $html; function __construct($a1) { $this->html = $a1; echo $this->html; echo "\n"; } function getURLs() { $regexa = '/\<a(.*)\<\/a\>/'; preg_match($regexa, $this->html, $matches); $a = $matches[1]; //echo $a; //echo "\n"; //echo "\n"; //Extract no d'annonces $regexno = '/name="(\d+)"/i'; preg_match($regexno, $a, $matches); //echo 'id:'; //echo $matches[1]; //echo "\n"; //Extract url des fiches $regexurl = '/href="(\S+)"/i'; preg_match($regexurl, $a, $matches); //echo 'url:'; //echo $matches[1]; echo "\n"; $url_fiche = 'http://www.kijiji.ca' . $matches[1]; echo $url_fiche; echo "\n"; return $matches; } } class AdInfoExtractor { //private $html = 0; //function __construct($a1) //{ //$this->html = $a1; //} function getHMTL($html) { echo '------'.$html; $regexatt = '/\<table class="ad-attributes">(.*)\<\/table\>/'; preg_match($regexatt, $html, $matches); $a = $matches[1]; $regexcontent = '/\<div id="UserContent">(.*)\<\/div\>/'; preg_match($regexcontent, $html, $matches); $b = $matches[1]; return $a . $b; } } class HTMLReader { function getHTML($url) { echo "\n"; echo 'url::'.$url; if ($url='http://www.kijiji.ca/b-autos-camions/grand-montreal/suv+vgm-nissan-rogue-2001__2009/c174l80002a138a54a1000054a68?sort=priceAsc&price=2000.00__40000.00&kilometres=10000__110000"') { echo "\n"; echo 'true'; echo "\n"; return "liste <td class=\"description\"><a href=\"/v-autos-camions/ville-de-montreal/2008-bmw-x5-suv/568081363\" class=\"title enable-search-navigation-flag\" name=\"568081363\">2008 BMW X5 SUV</a><p>"; } else { echo "\n"; echo 'false'; echo "\n"; return 'fiche <table class="ad-attributes">yesser</table> dfdssd <div id="UserContent">good</div> dfdfdf df df'; } echo "\n"; } } $dal = new DAL(); $mail_html = ''; foreach ($dal->getURLRecherches() as $line_num => $line) { echo $line; echo "\n"; $reader = new HTMLReader(); $liste = new AdsListExtractor($reader->getHTML($line)); echo "\n"; foreach ($liste->getURLs() as $line_number => $line2) { echo "\n"; $htmlfiche = $reader->getHTML($line2); echo "\n"; $ad_info = new AdInfoExtractor(); $mail_html = $mail_html . $ad_info->getHMTL($htmlfiche); echo "\n"; } }

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.0100.00718.55
8.3.50.0110.00522.05
8.3.40.0060.00919.09
8.3.30.0080.00819.21
8.3.20.0030.00520.25
8.3.10.0050.00322.04
8.3.00.0000.00822.51
8.2.180.0090.00916.75
8.2.170.0150.00622.96
8.2.160.0090.00619.33
8.2.150.0030.00524.18
8.2.140.0000.00924.66
8.2.130.0040.00426.16
8.2.120.0080.00819.58
8.2.110.0060.00320.51
8.2.100.0080.00417.97
8.2.90.0040.00419.36
8.2.80.0080.00017.97
8.2.70.0060.00317.88
8.2.60.0030.00518.03
8.2.50.0000.00818.07
8.2.40.0090.00018.16
8.2.30.0040.00418.07
8.2.20.0040.00417.85
8.2.10.0030.00617.91
8.2.00.0050.00318.06
8.1.280.0100.00725.92
8.1.270.0030.00623.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00723.74
8.1.230.0060.00620.94
8.1.220.0050.00317.80
8.1.210.0030.00518.77
8.1.200.0070.00317.60
8.1.190.0090.00017.65
8.1.180.0030.00618.85
8.1.170.0040.00418.72
8.1.160.0040.00422.11
8.1.150.0040.00418.87
8.1.140.0040.00417.70
8.1.130.0000.00717.94
8.1.120.0040.00417.54
8.1.110.0040.00417.54
8.1.100.0050.00317.69
8.1.90.0040.00417.52
8.1.80.0040.00417.65
8.1.70.0000.00717.50
8.1.60.0060.00317.73
8.1.50.0000.00717.61
8.1.40.0000.00817.68
8.1.30.0030.00517.83
8.1.20.0080.00017.84
8.1.10.0000.00717.76
8.1.00.0000.00917.56
8.0.300.0000.00818.77
8.0.290.0040.00417.18
8.0.280.0030.00718.41
8.0.270.0000.00717.23
8.0.260.0050.00217.07
8.0.250.0050.00317.21
8.0.240.0000.00717.18
8.0.230.0040.00417.08
8.0.220.0050.00217.20
8.0.210.0000.00817.20
8.0.200.0040.00417.09
8.0.190.0000.00717.25
8.0.180.0020.00517.18
8.0.170.0060.00317.15
8.0.160.0080.00017.19
8.0.150.0000.00717.09
8.0.140.0040.00417.11
8.0.130.0000.00613.54
8.0.120.0040.00417.00
8.0.110.0050.00317.18
8.0.100.0030.00517.24
8.0.90.0030.00517.20
8.0.80.0090.00617.10
8.0.70.0040.00417.13
8.0.60.0040.00417.15
8.0.50.0000.00817.20
8.0.30.0100.01017.21
8.0.20.0170.00717.40
8.0.10.0050.00217.15
8.0.00.0120.00717.12
7.4.330.0000.00615.11
7.4.320.0000.00716.73
7.4.300.0030.00316.72
7.4.290.0050.00316.77
7.4.280.0000.00716.71
7.4.270.0000.00716.74
7.4.260.0060.00316.81
7.4.250.0040.00416.67
7.4.240.0050.00316.74
7.4.230.0000.00716.65
7.4.220.0090.01616.75
7.4.210.0090.00616.81
7.4.200.0030.00516.78
7.4.190.0050.00216.99
7.4.160.0110.01116.76
7.4.150.0040.01517.40
7.4.140.0140.00917.86
7.4.130.0150.00916.83
7.4.120.0080.01016.77
7.4.110.0080.01316.93
7.4.100.0060.01416.74
7.4.90.0140.01016.75
7.4.80.0050.01419.39
7.4.70.0180.00616.70
7.4.60.0160.00016.63
7.4.50.0070.00316.44
7.4.40.0060.00622.77
7.4.30.0070.01516.64
7.4.00.0040.01415.21
7.3.330.0060.00013.60
7.3.320.0000.00613.55
7.3.310.0000.00716.71
7.3.300.0070.00016.63
7.3.290.0040.01116.59
7.3.280.0080.01016.54
7.3.270.0080.01117.40
7.3.260.0160.00316.85
7.3.250.0110.00716.74
7.3.240.0090.00916.80
7.3.230.0140.01016.59
7.3.210.0110.00816.83
7.3.200.0100.00719.39
7.3.190.0140.00416.78
7.3.180.0030.01516.80
7.3.170.0100.00716.86
7.3.160.0120.00616.78
7.3.120.0040.00714.64
7.2.330.0150.00316.90
7.2.320.0090.00916.82
7.2.310.0090.00916.92
7.2.300.0070.01016.79
7.2.290.0100.00716.93
7.2.60.0110.00916.93
7.2.50.0160.00416.95
7.1.200.0030.01016.04
7.1.70.0040.01117.36
7.1.60.0000.01117.20
7.1.50.0060.00917.22
7.1.00.0030.07722.31
7.0.200.0090.00916.89
7.0.140.0070.07022.00
7.0.60.0100.06019.99
7.0.50.0070.07317.93
7.0.40.0030.04720.27
7.0.30.0270.07020.29
7.0.20.0270.04020.32
7.0.10.0170.04720.23
7.0.00.0030.04320.32
5.6.280.0100.06720.90
5.6.210.0030.07020.47
5.6.200.0100.05018.32
5.6.190.0170.03020.47
5.6.180.4030.04320.77
5.6.170.0200.04720.54
5.6.160.0030.05320.44
5.6.150.0030.05718.22
5.6.140.0130.05018.21
5.6.130.0100.03318.16
5.6.120.0070.08721.03
5.6.110.0200.06021.03
5.6.100.0070.09021.03
5.6.90.0030.04320.99
5.6.80.0070.03720.35
5.6.70.3330.03720.45
5.5.350.0030.03320.44
5.5.340.0100.06017.98
5.5.330.0070.04020.31
5.5.320.0370.05720.38
5.5.310.0200.04320.37
5.5.300.0070.07718.04
5.5.290.0100.04017.97
5.5.280.0100.08320.82
5.5.270.0100.07720.75
5.5.260.0030.04020.78
5.5.250.0130.08320.63
5.5.240.0030.05020.28
5.4.450.0630.05319.36
5.4.440.0600.05719.48
5.4.430.0130.05019.34
5.4.420.0470.05719.31
5.4.410.0570.05719.28
5.4.400.0870.00018.77
5.4.390.0930.00018.77
5.4.380.0270.05318.75
5.4.370.0330.05318.71
5.4.360.0200.05718.52
5.4.350.0230.05318.82
5.4.340.0300.05018.61
5.4.320.0070.03512.52
5.4.310.0080.03712.51
5.4.300.0080.03812.52
5.4.290.0080.04112.51
5.4.280.0070.03812.41
5.4.270.0050.03612.41
5.4.260.0030.05318.89
5.4.250.0170.06718.91
5.4.240.0030.08318.88
5.4.230.0070.05718.75
5.4.220.0030.06318.91
5.4.210.0070.08318.83
5.4.200.0130.05318.80
5.4.190.0030.05719.06
5.4.180.0200.06719.06
5.4.170.0100.05718.60
5.4.160.0130.04718.92
5.4.150.0130.05318.96
5.4.140.0000.08316.38
5.4.130.0100.04716.39
5.4.120.0070.05316.37
5.4.110.0100.05016.68
5.4.100.0070.05016.52
5.4.90.0100.07016.48
5.4.80.0000.05716.43
5.4.70.0070.07316.33
5.4.60.0030.05316.25
5.4.50.0030.05316.35
5.4.40.0070.04716.32
5.4.30.0100.05016.32
5.4.20.0030.05716.45
5.4.10.0070.07716.39
5.4.00.0100.05015.96
5.3.290.0060.04412.80
5.3.280.0070.07714.62
5.3.270.0070.06014.76
5.3.260.0130.04714.80
5.3.250.0000.06014.63
5.3.240.0000.06314.71
5.3.230.0130.06314.71
5.3.220.0130.05714.77
5.3.210.0070.08014.42
5.3.200.0100.05314.73
5.3.190.0130.05014.67
5.3.180.0070.05014.67
5.3.170.0030.06014.67
5.3.160.0100.06314.80
5.3.150.0000.05714.61
5.3.140.0130.04014.74
5.3.130.0000.06014.79
5.3.120.0100.05714.65
5.3.110.0100.05014.55
5.3.100.0030.05714.25
5.3.90.0030.07714.13
5.3.80.0030.06314.02
5.3.70.0170.04314.05
5.3.60.0100.06714.00
5.3.50.0100.04714.05
5.3.40.0030.05314.05
5.3.30.0070.07313.90
5.3.20.0100.06313.88
5.3.10.0170.03713.66
5.3.00.0030.07013.66
5.2.170.0070.04011.39
5.2.160.0100.04311.00
5.2.150.0030.05311.25
5.2.140.0070.05711.13
5.2.130.0030.06011.20
5.2.120.0030.04011.08
5.2.110.0070.05311.19
5.2.100.0070.05711.23
5.2.90.0070.04011.11
5.2.80.0070.04011.02
5.2.70.0100.04011.28
5.2.60.0030.04711.15
5.2.50.0170.04711.18
5.2.40.0030.04311.02
5.2.30.0070.04010.98
5.2.20.0000.04310.96
5.2.10.0070.04010.97
5.2.00.0070.04310.81
5.1.60.0000.03710.12
5.1.50.0100.0339.94
5.1.40.0000.04010.07
5.1.30.0070.03310.43
5.1.20.0000.04010.35
5.1.10.0070.03710.13
5.1.00.0030.03310.25
5.0.50.0030.0278.82
5.0.40.0030.0278.68
5.0.30.0030.0408.33
5.0.20.0100.0208.28
5.0.10.0000.0338.25
5.0.00.0030.0438.44
4.4.90.0000.0276.39
4.4.80.0030.0276.39
4.4.70.0000.0236.39
4.4.60.0030.0176.39
4.4.50.0030.0206.39
4.4.40.0030.0306.39
4.4.30.0030.0206.39
4.4.20.0030.0206.39
4.4.10.0030.0176.39
4.4.00.0030.0306.39
4.3.110.0000.0236.39
4.3.100.0000.0206.39
4.3.90.0030.0176.39
4.3.80.0000.0376.39
4.3.70.0000.0236.39
4.3.60.0000.0206.39
4.3.50.0030.0206.39
4.3.40.0000.0336.39
4.3.30.0030.0236.39
4.3.20.0030.0276.39
4.3.10.0000.0306.39
4.3.00.0130.0176.64

preferences:
45.97 ms | 401 KiB | 5 Q