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 'AdsListExtractor.getURLs return' . $url_fiche; echo "\n"; return array( $url_fiche,$url_fiche ); } } 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 => $linee) { echo "\n"; $htmlfiche = $reader->getHTML($linee); 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.0120.00318.63
8.3.50.0120.00321.27
8.3.40.0040.01119.23
8.3.30.0180.00319.04
8.3.20.0080.00020.34
8.3.10.0050.00322.09
8.3.00.0000.00822.52
8.2.180.0100.00716.61
8.2.170.0090.00922.96
8.2.160.0140.00019.38
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00819.86
8.2.110.0110.00021.16
8.2.100.0090.00319.89
8.2.90.0000.00819.30
8.2.80.0060.00317.97
8.2.70.0050.00517.75
8.2.60.0080.00018.05
8.2.50.0030.00618.07
8.2.40.0040.00418.28
8.2.30.0000.00818.20
8.2.20.0000.00817.88
8.2.10.0060.00318.00
8.2.00.0000.00917.92
8.1.280.0110.00425.92
8.1.270.0060.00322.32
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0090.00019.41
8.1.230.0000.01219.22
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0030.00617.60
8.1.190.0080.00017.43
8.1.180.0060.00318.96
8.1.170.0000.00918.72
8.1.160.0000.00722.15
8.1.150.0040.00418.79
8.1.140.0050.00317.63
8.1.130.0040.00417.78
8.1.120.0040.00417.68
8.1.110.0060.00317.55
8.1.100.0050.00317.50
8.1.90.0030.00617.54
8.1.80.0040.00417.64
8.1.70.0000.00717.56
8.1.60.0030.00617.81
8.1.50.0000.00817.73
8.1.40.0090.00017.57
8.1.30.0040.00417.80
8.1.20.0080.00017.73
8.1.10.0030.00617.79
8.1.00.0040.00417.58
8.0.300.0070.00018.77
8.0.290.0000.00917.18
8.0.280.0070.00018.38
8.0.270.0030.00517.25
8.0.260.0070.00017.02
8.0.250.0040.00417.24
8.0.240.0000.00717.21
8.0.230.0040.00417.05
8.0.220.0000.00917.16
8.0.210.0070.00017.03
8.0.200.0030.00317.11
8.0.190.0000.00817.19
8.0.180.0000.00817.15
8.0.170.0060.00317.15
8.0.160.0030.00517.13
8.0.150.0040.00417.08
8.0.140.0050.00217.07
8.0.130.0030.00313.65
8.0.120.0050.00317.13
8.0.110.0050.00317.06
8.0.100.0040.00417.11
8.0.90.0080.00017.02
8.0.80.0120.00417.11
8.0.70.0000.00817.13
8.0.60.0040.00417.08
8.0.50.0040.00416.99
8.0.30.0130.01117.26
8.0.20.0080.01117.48
8.0.10.0000.00717.23
8.0.00.0100.00916.99
7.4.330.0020.00215.04
7.4.320.0070.00016.62
7.4.300.0000.00716.68
7.4.290.0040.00416.74
7.4.280.0000.00816.75
7.4.270.0070.00016.63
7.4.260.0000.01016.83
7.4.250.0040.00416.82
7.4.240.0020.00616.80
7.4.230.0070.00016.50
7.4.220.0000.01916.80
7.4.210.0080.00916.70
7.4.200.0050.00316.59
7.4.190.0000.00716.61
7.4.160.0110.00716.71
7.4.150.0110.00917.40
7.4.140.0160.00217.86
7.4.130.0080.01116.84
7.4.120.0140.00416.82
7.4.110.0110.00716.59
7.4.100.0060.01316.84
7.4.90.0060.01316.66
7.4.80.0070.01119.39
7.4.70.0140.00716.80
7.4.60.0070.01116.70
7.4.50.0040.00716.50
7.4.40.0110.00422.77
7.4.30.0080.00816.71
7.4.00.0100.00715.27
7.3.330.0000.00613.63
7.3.320.0030.00313.47
7.3.310.0030.00516.52
7.3.300.0070.00016.60
7.3.290.0100.01016.52
7.3.280.0060.01116.55
7.3.270.0120.00617.40
7.3.260.0110.00616.71
7.3.250.0120.00716.77
7.3.240.0070.01016.51
7.3.230.0170.00316.79
7.3.210.0100.01116.63
7.3.200.0070.01019.39
7.3.190.0080.00916.54
7.3.180.0140.00716.89
7.3.170.0070.01116.70
7.3.160.0100.00716.83
7.3.120.0120.00614.96
7.2.330.0120.01116.88
7.2.320.0060.01217.00
7.2.310.0140.00417.00
7.2.300.0110.00716.97
7.2.290.0100.00716.91
7.1.200.0130.00016.02
7.1.70.0250.00317.38
7.1.60.0120.00319.82
7.1.50.0060.01317.17
7.1.00.0070.07322.50
7.0.200.0030.00616.91
7.0.140.0070.06322.09
7.0.100.0070.07020.02
7.0.90.0370.07719.89
7.0.80.0130.08019.96
7.0.70.0170.07319.92
7.0.60.0030.08319.86
7.0.50.0070.08720.29
7.0.40.0170.06020.01
7.0.30.0070.08320.14
7.0.20.0100.07720.06
7.0.10.0100.08320.07
7.0.00.0130.08320.05
5.6.280.0100.06321.14
5.6.250.0130.07020.69
5.6.240.0070.08320.64
5.6.230.0030.08020.53
5.6.220.0070.08320.55
5.6.210.0070.08020.61
5.6.200.0200.04721.06
5.6.190.0130.07321.11
5.6.180.0070.07321.05
5.6.170.0100.08020.98
5.6.160.0070.08721.11
5.6.150.0100.08021.07
5.6.140.0030.05721.19
5.6.130.0100.07721.15
5.6.120.0100.07720.98
5.6.110.0030.05020.90
5.6.100.0030.08721.04
5.6.90.0000.05321.08
5.6.80.0200.06720.49
5.6.70.0100.08020.48
5.6.60.0070.08020.46
5.6.50.0070.08020.49
5.6.40.0100.04320.46
5.6.30.0170.05720.40
5.6.20.0100.07320.31
5.6.10.0100.06320.47
5.6.00.0030.08020.30
5.5.380.0070.08320.33
5.5.370.0070.08720.46
5.5.360.0200.06320.34
5.5.350.0070.08320.39
5.5.340.0130.05720.92
5.5.330.0070.07720.86
5.5.320.0130.07720.90
5.5.310.0100.07720.89
5.5.300.0100.08020.75
5.5.290.0200.06720.95
5.5.280.0070.08720.92
5.5.270.0100.07720.66
5.5.260.0100.08020.65
5.5.250.0000.07020.71
5.5.240.0070.06020.16
5.5.230.0100.08320.33
5.5.220.0100.07320.29
5.5.210.0100.07320.31
5.5.200.0130.06720.15
5.5.190.0070.04720.20
5.5.180.0130.07320.26
5.5.160.0070.05320.21
5.5.150.0070.05020.15
5.5.140.0030.04720.17
5.5.130.0130.06720.16
5.5.120.0100.05720.24
5.5.110.0070.08020.14
5.5.100.0100.05020.06
5.5.90.0100.06020.11
5.5.80.0100.07320.09
5.5.70.0030.08320.16
5.5.60.0100.07020.12
5.5.50.0000.05020.12
5.5.40.0070.07720.17
5.5.30.0070.04020.18
5.5.20.0100.07320.07
5.5.10.0100.08020.12
5.5.00.0030.08320.07
5.4.450.0030.06319.46
5.4.440.0170.05019.36
5.4.430.0100.05019.27
5.4.420.0100.04319.37
5.4.410.0030.08019.14
5.4.400.0270.05718.95
5.4.390.0070.07718.95
5.4.380.0030.05718.95
5.4.370.0100.04018.86
5.4.360.0200.06319.00
5.4.350.0030.05718.88
5.4.340.0000.05719.03
5.4.320.0130.06019.04
5.4.310.0170.06318.95
5.4.300.0030.06019.20
5.4.290.0070.07718.95
5.4.280.0130.07018.88
5.4.270.0030.07719.04
5.4.260.0070.07019.04
5.4.250.0070.04019.13
5.4.240.0130.03718.89
5.4.230.0170.08318.89
5.4.220.0070.06719.17
5.4.210.0170.06719.04
5.4.200.0100.06019.03
5.4.190.0130.07018.86
5.4.180.0100.03718.96
5.4.170.0070.05718.87
5.4.160.0100.07319.02
5.4.150.0100.07319.10
5.4.140.0100.07316.47
5.4.130.0200.05016.45
5.4.120.0070.06716.55
5.4.110.0100.06716.53
5.4.100.0070.07316.39
5.4.90.0000.07316.40
5.4.80.0070.04016.38
5.4.70.0070.07716.51
5.4.60.0070.04716.32
5.4.50.0030.07016.45
5.4.40.0070.07316.37
5.4.30.0070.07316.39
5.4.20.0070.07016.48
5.4.10.0100.06316.46
5.4.00.0100.05015.98
5.3.290.0100.04314.69
5.3.280.0030.07314.73
5.3.270.0030.08014.55
5.3.260.0100.07014.73
5.3.250.0030.07014.57
5.3.240.0070.08014.66
5.3.230.0130.04314.57
5.3.220.0130.07314.70
5.3.210.0070.06714.60
5.3.200.0070.05314.57
5.3.190.0100.05014.60
5.3.180.0130.04314.65
5.3.170.0230.05714.64
5.3.160.0030.07314.65
5.3.150.0000.08314.72
5.3.140.0170.07014.59
5.3.130.0200.06014.63
5.3.120.0000.08014.63
5.3.110.0100.07314.71
5.3.100.0230.05314.04
5.3.90.0130.05714.16
5.3.80.0030.08014.09
5.3.70.0000.05714.09
5.3.60.0130.06314.05
5.3.50.0000.07714.03
5.3.40.0030.07713.88
5.3.30.0100.06313.91
5.3.20.0070.04013.60
5.3.10.0000.07713.73
5.3.00.0070.07013.72
5.2.170.0030.06712.17
5.2.160.0030.03712.17
5.2.150.0030.05712.17
5.2.140.0070.05012.17
5.2.130.0070.06012.17
5.2.120.0030.05312.17
5.2.110.0030.06012.17
5.2.100.0130.05312.17
5.2.90.0100.05712.17
5.2.80.0070.05712.17
5.2.70.0100.05712.17
5.2.60.0100.05312.17
5.2.50.0000.04312.17
5.2.40.0070.06012.17
5.2.30.0070.06312.17
5.2.20.0070.06012.17
5.2.10.0030.06312.17
5.2.00.0100.05312.17
5.1.60.0070.04312.17
5.1.50.0030.05712.17
5.1.40.0070.05012.17
5.1.30.0030.04012.17
5.1.20.0070.05312.17
5.1.10.0070.05012.17
5.1.00.0070.05012.17
5.0.50.0070.04312.17
5.0.40.0000.05012.17
5.0.30.0130.04012.17
5.0.20.0030.03012.17
5.0.10.0000.02312.17
5.0.00.0070.05712.17
4.4.90.0000.02712.17
4.4.80.0030.03712.17
4.4.70.0030.02312.17
4.4.60.0030.03312.17
4.4.50.0070.01312.17
4.4.40.0030.05012.17
4.4.30.0030.03712.17
4.4.20.0000.03012.17
4.4.10.0000.04012.17
4.4.00.0000.03012.17
4.3.110.0030.03312.17
4.3.100.0000.03712.17
4.3.90.0000.01712.17
4.3.80.0030.02712.17
4.3.70.0030.02712.17
4.3.60.0030.03312.17
4.3.50.0000.03312.17
4.3.40.0000.02712.17
4.3.30.0070.02312.17
4.3.20.0000.03012.17
4.3.10.0030.01712.17
4.3.00.0030.02312.17

preferences:
38.81 ms | 401 KiB | 5 Q