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 '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 '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 'false'; return 'fiche <table class="ad-attributes">yesser</table> dfdssd <div id="UserContent">good</div> dfdfdf df df'; } } } $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)); foreach ($liste->getURLs() as $line_number => $line2) { $htmlfiche = $reader->getHTML($line2); $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.60.0070.01118.29
8.3.50.0140.00422.04
8.3.40.0110.00419.09
8.3.30.0100.01019.11
8.3.20.0080.00020.34
8.3.10.0080.00021.95
8.3.00.0060.00322.49
8.2.180.0160.00316.88
8.2.170.0090.00922.96
8.2.160.0090.00619.29
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0000.00926.16
8.2.120.0040.00419.73
8.2.110.0030.00622.21
8.2.100.0070.00720.01
8.2.90.0040.00419.34
8.2.80.0040.00418.29
8.2.70.0030.00617.88
8.2.60.0090.00018.05
8.2.50.0050.00318.07
8.2.40.0040.00418.34
8.2.30.0030.00518.18
8.2.20.0050.00217.98
8.2.10.0000.00817.88
8.2.00.0080.00018.03
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0000.00823.73
8.1.230.0070.00319.34
8.1.220.0000.00917.79
8.1.210.0040.00418.77
8.1.200.0080.00317.60
8.1.190.0050.00317.64
8.1.180.0060.00318.85
8.1.170.0060.00318.84
8.1.160.0080.00022.21
8.1.150.0000.00718.84
8.1.140.0060.00317.63
8.1.130.0000.00717.82
8.1.120.0040.00417.69
8.1.110.0030.00617.67
8.1.100.0000.00717.71
8.1.90.0030.00617.54
8.1.80.0040.00417.55
8.1.70.0000.00717.60
8.1.60.0090.00017.82
8.1.50.0000.00817.76
8.1.40.0040.00417.63
8.1.30.0040.00417.80
8.1.20.0040.00417.87
8.1.10.0080.00017.82
8.1.00.0000.00817.72
8.0.300.0000.00718.77
8.0.290.0060.00317.18
8.0.280.0050.00318.40
8.0.270.0040.00417.32
8.0.260.0030.00317.04
8.0.250.0000.00917.07
8.0.240.0040.00317.08
8.0.230.0030.00317.23
8.0.220.0000.00717.16
8.0.210.0070.00017.15
8.0.200.0000.00717.10
8.0.190.0000.00717.11
8.0.180.0070.00017.23
8.0.170.0000.00817.08
8.0.160.0030.00617.02
8.0.150.0040.00417.09
8.0.140.0040.00417.09
8.0.130.0030.00313.54
8.0.120.0080.00017.20
8.0.110.0000.00817.11
8.0.100.0080.00016.95
8.0.90.0050.00317.03
8.0.80.0090.00617.15
8.0.70.0000.00817.11
8.0.60.0000.00717.05
8.0.50.0030.00517.15
8.0.30.0170.00617.28
8.0.20.0120.00717.49
8.0.10.0030.00617.27
8.0.00.0170.00516.98
7.4.330.0000.00515.16
7.4.320.0080.00016.79
7.4.300.0030.00316.69
7.4.290.0000.00716.88
7.4.280.0030.00616.84
7.4.270.0070.00016.90
7.4.260.0070.00316.75
7.4.250.0030.00616.65
7.4.240.0060.00216.78
7.4.230.0030.00316.79
7.4.220.0090.00916.70
7.4.210.0020.01216.80
7.4.200.0020.00516.85
7.4.190.0000.00717.02
7.4.160.0030.01516.92
7.4.150.0070.01317.40
7.4.140.0160.00217.86
7.4.130.0100.00916.87
7.4.120.0130.00916.86
7.4.110.0070.01016.89
7.4.100.0070.01116.84
7.4.90.0090.00916.92
7.4.80.0050.01419.39
7.4.70.0110.01116.90
7.4.60.0100.00716.96
7.4.50.0050.00016.56
7.4.40.0030.01022.77
7.4.30.0030.01416.91
7.4.00.0110.00415.09
7.3.330.0030.00313.45
7.3.320.0030.00313.40
7.3.310.0000.00716.69
7.3.300.0030.00316.46
7.3.290.0100.00716.55
7.3.280.0130.00516.54
7.3.270.0070.01117.40
7.3.260.0110.00716.78
7.3.250.0180.00416.77
7.3.240.0120.00616.64
7.3.230.0060.01616.59
7.3.210.0130.00716.87
7.3.200.0030.01416.68
7.3.190.0070.01116.52
7.3.180.0100.00916.59
7.3.170.0120.00416.62
7.3.160.0120.00616.75
7.3.120.0060.00915.29
7.2.330.0030.01516.84
7.2.320.0060.02016.93
7.2.310.0080.01116.93
7.2.300.0060.01216.89
7.2.290.0170.00016.88
7.2.00.0000.01219.81
7.1.200.0030.00716.04
7.1.100.0060.00318.26
7.1.70.0000.00817.42
7.1.60.0140.00719.82
7.1.50.0070.02017.23
7.1.00.0030.07022.38
7.0.200.0030.00916.71
7.0.140.0070.07021.97
7.0.60.0030.08019.99
7.0.50.0100.06718.05
7.0.40.0070.04020.05
7.0.30.0230.08720.15
7.0.20.0270.04320.35
7.0.10.0200.08720.17
7.0.00.0130.07720.09
5.6.280.0030.07321.04
5.6.210.0100.06320.62
5.6.200.0070.03718.27
5.6.190.0030.09320.33
5.6.180.3870.04020.50
5.6.170.0400.07020.71
5.6.160.0030.08720.61
5.6.150.0030.06018.27
5.6.140.0030.08318.33
5.6.130.0030.04018.21
5.6.120.0170.05721.04
5.6.110.0170.07721.04
5.6.100.0130.08020.99
5.6.90.0100.06721.02
5.6.80.0170.07020.52
5.6.70.4030.03320.45
5.5.350.0070.03720.44
5.5.340.0100.08017.97
5.5.330.0070.03720.37
5.5.320.0100.04720.32
5.5.310.0230.06020.34
5.5.300.0070.08317.96
5.5.290.0070.03717.98
5.5.280.0100.04020.70
5.5.270.0170.07320.86
5.5.260.0000.09020.99
5.5.250.0070.03720.64
5.5.240.0100.07020.25
5.4.450.0370.06319.59
5.4.440.0530.04719.55
5.4.430.0470.06719.46
5.4.420.0600.06019.58
5.4.410.0530.05719.31
5.4.400.1030.00018.87
5.4.390.0730.00018.63
5.4.380.0300.05318.49
5.4.370.0130.04718.57
5.4.360.1070.04018.54
5.4.350.1030.05318.76
5.4.340.0970.06018.81
5.4.320.0040.03912.52
5.4.310.0110.03412.51
5.4.300.0110.03912.52
5.4.290.0070.03812.52
5.4.280.0070.03412.41
5.4.270.0070.03912.41
5.4.260.0130.05018.95
5.4.250.0170.05018.65
5.4.240.0000.06018.84
5.4.230.0100.05018.84
5.4.220.0200.07318.77
5.4.210.0170.07718.95
5.4.200.0070.07718.83
5.4.190.0130.05019.09
5.4.180.0100.04718.99
5.4.170.0100.05318.79
5.4.160.0130.05018.71
5.4.150.0070.05718.75
5.4.140.0070.06016.48
5.4.130.0070.05316.51
5.4.120.0170.04716.47
5.4.110.0100.07016.57
5.4.100.0000.07016.44
5.4.90.0000.05716.54
5.4.80.0100.04716.53
5.4.70.0070.05016.61
5.4.60.0230.04016.59
5.4.50.0100.05316.62
5.4.40.0030.06016.47
5.4.30.0100.04716.32
5.4.20.0100.05016.38
5.4.10.0070.05716.33
5.4.00.0030.07316.07
5.3.290.0060.03912.80
5.3.280.0070.05314.84
5.3.270.0070.05314.70
5.3.260.0100.05014.79
5.3.250.0130.07014.79
5.3.240.0100.05314.77
5.3.230.0030.05314.69
5.3.220.0100.06714.72
5.3.210.0100.05314.75
5.3.200.0100.07314.50
5.3.190.0070.05014.79
5.3.180.0070.06314.67
5.3.170.0130.04314.75
5.3.160.0070.05314.59
5.3.150.0100.07014.66
5.3.140.0170.06314.65
5.3.130.0030.05714.57
5.3.120.0100.05014.65
5.3.110.0070.06014.79
5.3.100.0100.05014.28
5.3.90.0130.06713.95
5.3.80.0130.05014.02
5.3.70.0030.07014.02
5.3.60.0200.04014.23
5.3.50.0070.05013.95
5.3.40.0070.05013.96
5.3.30.0000.08013.95
5.3.20.0100.05013.80
5.3.10.0000.05713.76
5.3.00.0070.05013.49
5.2.170.0170.05011.39
5.2.160.0130.04011.17
5.2.150.0030.04711.24
5.2.140.0100.05711.17
5.2.130.0100.05311.19
5.2.120.0070.03711.13
5.2.110.0100.04311.10
5.2.100.0000.05311.20
5.2.90.0030.05710.95
5.2.80.0130.04011.17
5.2.70.0070.04711.28
5.2.60.0030.05311.05
5.2.50.0100.04311.14
5.2.40.0030.05711.21
5.2.30.0070.04311.01
5.2.20.0070.04310.98
5.2.10.0070.04710.88
5.2.00.0030.04310.70
5.1.60.0030.03710.07
5.1.50.0130.02710.09
5.1.40.0170.03710.10
5.1.30.0130.04010.33
5.1.20.0070.03710.60
5.1.10.0070.03310.29
5.1.00.0100.04010.10
5.0.50.0030.0408.63
5.0.40.0070.0238.43
5.0.30.0030.0538.36
5.0.20.0070.0378.22
5.0.10.0030.0278.19
5.0.00.0130.0378.22
4.4.90.0000.0236.30
4.4.80.0000.0306.30
4.4.70.0070.0176.30
4.4.60.0070.0206.30
4.4.50.0070.0276.30
4.4.40.0030.0336.30
4.4.30.0000.0236.30
4.4.20.0000.0306.30
4.4.10.0100.0176.30
4.4.00.0000.0376.30
4.3.110.0030.0236.30
4.3.100.0000.0236.30
4.3.90.0070.0176.30
4.3.80.0030.0336.30
4.3.70.0070.0176.30
4.3.60.0000.0236.30
4.3.50.0100.0236.30
4.3.40.0000.0336.30
4.3.30.0030.0206.30
4.3.20.0070.0236.30
4.3.10.0030.0276.30
4.3.00.0070.0277.10

preferences:
53.87 ms | 401 KiB | 5 Q