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() { echo '------'.$this->html; $regexatt = '/\<table class="ad-attributes">(.*)\<\/table\>/'; preg_match($regexatt, $this->html, $matches); $a = $matches[1]; $regexcontent = '/\<div id="UserContent">(.*)\<\/div\>/'; preg_match($regexcontent, $this->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'; 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'; 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($htmlfiche); $mail_html = $mail_html . $ad_info->getHMTL(); 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.70.0210.00317.13
8.3.60.0130.00618.56
8.3.50.0130.00822.23
8.3.40.0110.00419.27
8.3.30.0060.00919.04
8.3.20.0080.00020.04
8.3.10.0050.00322.09
8.3.00.0090.00022.52
8.2.190.0070.01417.00
8.2.180.0100.01017.13
8.2.170.0150.00022.96
8.2.160.0120.00319.29
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00319.50
8.2.110.0000.00922.37
8.2.100.0120.00019.88
8.2.90.0040.00419.16
8.2.80.0000.00818.04
8.2.70.0030.00617.88
8.2.60.0080.00017.92
8.2.50.0000.00818.07
8.2.40.0000.00818.16
8.2.30.0050.00319.85
8.2.20.0040.00417.96
8.2.10.0040.00417.93
8.2.00.0080.00017.87
8.1.280.0140.00425.92
8.1.270.0090.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00423.66
8.1.230.0040.00819.22
8.1.220.0040.00417.89
8.1.210.0000.00918.77
8.1.200.0070.00417.59
8.1.190.0080.00017.79
8.1.180.0000.00818.62
8.1.170.0090.00018.79
8.1.160.0020.00522.21
8.1.150.0000.00818.87
8.1.140.0000.00817.68
8.1.130.0040.00417.80
8.1.120.0040.00417.65
8.1.110.0070.00017.54
8.1.100.0000.00717.68
8.1.90.0040.00417.56
8.1.80.0040.00417.59
8.1.70.0000.00717.54
8.1.60.0090.00017.66
8.1.50.0080.00017.75
8.1.40.0030.00517.74
8.1.30.0040.00417.71
8.1.20.0000.00817.71
8.1.10.0000.00717.66
8.1.00.0040.00417.59
8.0.300.0000.00718.77
8.0.290.0020.00517.05
8.0.280.0040.00418.38
8.0.270.0050.00317.32
8.0.260.0000.00817.07
8.0.250.0000.00817.11
8.0.240.0000.00717.25
8.0.230.0040.00417.16
8.0.220.0030.00317.13
8.0.210.0030.00317.18
8.0.200.0000.00617.09
8.0.190.0050.00217.17
8.0.180.0000.00717.14
8.0.170.0040.00417.10
8.0.160.0040.00417.04
8.0.150.0030.00616.99
8.0.140.0040.00417.11
8.0.130.0030.00313.53
8.0.120.0000.00817.10
8.0.110.0000.00817.19
8.0.100.0000.00817.24
8.0.90.0040.00417.18
8.0.80.0080.00817.17
8.0.70.0000.00817.18
8.0.60.0000.00817.02
8.0.50.0030.00617.03
8.0.30.0130.00817.36
8.0.20.0130.01217.44
8.0.10.0000.00717.13
8.0.00.0090.00916.93
7.4.330.0000.00515.12
7.4.320.0070.00016.83
7.4.300.0030.00316.86
7.4.290.0000.00716.86
7.4.280.0040.00416.68
7.4.270.0030.00316.76
7.4.260.0050.00316.71
7.4.250.0050.00216.71
7.4.240.0040.00416.82
7.4.230.0070.00016.89
7.4.220.0030.01616.96
7.4.210.0090.00716.88
7.4.200.0050.00316.65
7.4.190.0000.00716.89
7.4.160.0110.00616.72
7.4.150.0160.00317.40
7.4.140.0080.01317.86
7.4.130.0110.00916.69
7.4.120.0050.01316.78
7.4.110.0070.01116.86
7.4.100.0170.00716.76
7.4.90.0140.00916.79
7.4.80.0130.00619.39
7.4.70.0160.00616.84
7.4.60.0200.00316.81
7.4.50.0000.00416.56
7.4.40.0100.00622.77
7.4.30.0140.00316.54
7.4.00.0030.01314.98
7.3.330.0050.00013.47
7.3.320.0050.00013.52
7.3.310.0030.00316.63
7.3.300.0070.00016.54
7.3.290.0130.00716.56
7.3.280.0090.00816.55
7.3.270.0120.00617.40
7.3.260.0080.01216.76
7.3.250.0120.00616.76
7.3.240.0110.00816.68
7.3.230.0110.01416.81
7.3.210.0090.01316.58
7.3.200.0070.01019.39
7.3.190.0180.00316.65
7.3.180.0030.01916.65
7.3.170.0100.00716.79
7.3.160.0090.00916.68
7.3.120.0070.01014.78
7.2.330.0090.00916.75
7.2.320.0090.00916.83
7.2.310.0070.01116.91
7.2.300.0130.00516.87
7.2.290.0120.00616.82
7.2.60.0080.00417.30
7.1.200.0070.00715.97
7.1.70.0100.00717.54
7.1.60.0000.01719.82
7.1.50.0130.01317.28
7.1.00.0070.09022.42
7.0.200.0030.00516.89
7.0.140.0100.06722.10
7.0.60.0030.04020.01
7.0.50.0030.05018.03
7.0.40.0100.07020.22
7.0.30.0270.07320.09
7.0.20.0270.07720.09
7.0.10.0000.07720.18
7.0.00.0100.08720.09
5.6.280.0030.07321.11
5.6.210.0030.06720.68
5.6.200.0030.04318.18
5.6.190.0030.05320.64
5.6.180.4130.03320.45
5.6.170.0270.08020.46
5.6.160.0070.05020.44
5.6.150.0100.07718.20
5.6.140.0000.04318.31
5.6.130.0100.07718.25
5.6.120.0170.07321.13
5.6.110.0100.08721.00
5.6.100.0070.08721.01
5.6.90.0070.03721.01
5.6.80.0070.08020.53
5.5.350.0300.05020.32
5.5.340.0000.04017.99
5.5.330.0100.05720.27
5.5.320.0330.07020.27
5.5.310.0270.07720.29
5.5.300.0070.03717.97
5.5.290.0030.04018.05
5.5.280.0000.05020.89
5.5.270.0030.06721.00
5.5.260.0070.08720.76
5.5.250.0100.03320.70
5.5.240.3070.03320.28
5.4.450.0900.03719.52
5.4.440.0830.03719.30
5.4.430.0500.04019.16
5.4.420.0330.04019.30
5.4.410.0270.04019.42
5.4.400.0370.04719.25
5.4.390.0470.04718.84
5.4.380.0370.05018.83
5.4.370.0330.07718.52
5.4.360.0300.05318.83
5.4.350.0470.04718.74
5.4.340.0330.05018.66
5.4.320.0070.04112.52
5.4.310.0080.03512.52
5.4.300.0090.03512.52
5.4.290.0080.04212.51
5.4.280.0070.03512.41
5.4.270.0030.03912.41
5.4.260.0130.04318.89
5.4.250.0030.05718.74
5.4.240.0130.05018.91
5.4.230.0130.04718.82
5.4.220.0070.05018.64
5.4.210.0070.05018.96
5.4.200.0130.04318.88
5.4.190.0170.04718.64
5.4.180.0030.05318.72
5.4.170.0130.07318.94
5.4.160.0030.05718.79
5.4.150.0200.04318.98
5.4.140.0130.05016.56
5.4.130.0070.06016.54
5.4.120.0100.05016.57
5.4.110.0000.05716.53
5.4.100.0130.04016.43
5.4.90.0000.05716.54
5.4.80.0000.05716.54
5.4.70.0100.05016.50
5.4.60.0070.05316.34
5.4.50.0170.04016.42
5.4.40.0100.05316.51
5.4.30.0070.05016.52
5.4.20.0030.05716.39
5.4.10.0270.04016.53
5.4.00.0100.06015.77
5.3.290.0040.04212.80
5.3.280.0070.05314.71
5.3.270.0170.07014.63
5.3.260.0100.05314.72
5.3.250.0070.05714.85
5.3.240.0100.06714.79
5.3.230.0070.05014.68
5.3.220.0130.04714.42
5.3.210.0030.05714.81
5.3.200.0070.05314.82
5.3.190.0070.05314.56
5.3.180.0100.05014.72
5.3.170.0170.04014.59
5.3.160.0100.05314.76
5.3.150.0100.07014.75
5.3.140.0100.05714.65
5.3.130.0130.04714.59
5.3.120.0200.04014.54
5.3.110.0130.04714.72
5.3.100.0100.05014.15
5.3.90.0030.05314.12
5.3.80.0170.05314.11
5.3.70.0100.05014.26
5.3.60.0070.05314.18
5.3.50.0070.05313.97
5.3.40.0070.07314.19
5.3.30.0130.06713.77
5.3.20.0130.06313.79
5.3.10.0170.03713.68
5.3.00.0100.04713.82
5.2.170.0170.03011.25
5.2.160.0030.04311.07
5.2.150.0170.04311.23
5.2.140.0070.04011.15
5.2.130.0130.05311.21
5.2.120.0130.03711.03
5.2.110.0030.05711.10
5.2.100.0030.04311.13
5.2.90.0100.03711.13
5.2.80.0170.05011.20
5.2.70.0100.04011.20
5.2.60.0100.04011.14
5.2.50.0070.04011.01
5.2.40.0030.04711.03
5.2.30.0070.04011.07
5.2.20.0070.05311.21
5.2.10.0070.04010.96
5.2.00.0070.03710.82
5.1.60.0070.03310.03
5.1.50.0070.03310.02
5.1.40.0000.0379.93
5.1.30.0070.03310.52
5.1.20.0070.04010.46
5.1.10.0000.04010.05
5.1.00.0100.04010.07
5.0.50.0070.0278.43
5.0.40.0030.0338.64
5.0.30.0030.0438.25
5.0.20.0100.0208.39
5.0.10.0130.0338.45
5.0.00.0000.0438.35
4.4.90.0100.0176.38
4.4.80.0000.0236.38
4.4.70.0000.0336.38
4.4.60.0030.0276.38
4.4.50.0070.0176.38
4.4.40.0030.0376.38
4.4.30.0030.0206.38
4.4.20.0000.0306.38
4.4.10.0030.0206.38
4.4.00.0030.0306.38
4.3.110.0030.0206.38
4.3.100.0070.0206.38
4.3.90.0000.0236.38
4.3.80.0000.0336.38
4.3.70.0000.0206.38
4.3.60.0000.0236.38
4.3.50.0000.0236.38
4.3.40.0000.0336.38
4.3.30.0030.0206.38
4.3.20.0030.0206.38
4.3.10.0000.0236.38
4.3.00.0070.00712.80

preferences:
38.33 ms | 401 KiB | 5 Q