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)); 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.70.0120.00616.75
8.3.60.0040.01518.81
8.3.50.0080.00722.05
8.3.40.0070.01319.00
8.3.30.0100.00719.26
8.3.20.0080.00020.41
8.3.10.0040.00422.14
8.3.00.0050.00322.54
8.2.180.0060.01217.00
8.2.170.0110.00422.96
8.2.160.0120.00319.46
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0060.00321.13
8.2.110.0060.00322.26
8.2.100.0080.00419.82
8.2.90.0040.00419.34
8.2.80.0080.00018.16
8.2.70.0030.00617.88
8.2.60.0060.00318.05
8.2.50.0000.00818.07
8.2.40.0040.00418.47
8.2.30.0050.00318.20
8.2.20.0030.00517.87
8.2.10.0000.00818.02
8.2.00.0040.00417.89
8.1.280.0110.00725.92
8.1.270.0000.00822.27
8.1.260.0130.00726.35
8.1.250.0000.00828.09
8.1.240.0000.00923.97
8.1.230.0070.00419.19
8.1.220.0040.00417.91
8.1.210.0040.00418.77
8.1.200.0030.00617.60
8.1.190.0000.00817.78
8.1.180.0000.00818.81
8.1.170.0030.00618.75
8.1.160.0040.00422.29
8.1.150.0030.00518.78
8.1.140.0000.00717.58
8.1.130.0040.00417.92
8.1.120.0050.00317.61
8.1.110.0050.00317.69
8.1.100.0000.00717.66
8.1.90.0040.00417.54
8.1.80.0020.00517.60
8.1.70.0080.00017.63
8.1.60.0040.00517.83
8.1.50.0040.00417.68
8.1.40.0030.00517.70
8.1.30.0000.00817.87
8.1.20.0040.00417.86
8.1.10.0040.00417.70
8.1.00.0090.00017.72
8.0.300.0070.00018.77
8.0.290.0040.00417.30
8.0.280.0080.00018.45
8.0.270.0000.00817.35
8.0.260.0030.00317.04
8.0.250.0040.00417.27
8.0.240.0040.00417.25
8.0.230.0000.00717.12
8.0.220.0080.00017.17
8.0.210.0000.00717.15
8.0.200.0030.00317.12
8.0.190.0000.00717.23
8.0.180.0040.00417.17
8.0.170.0030.00517.14
8.0.160.0040.00417.21
8.0.150.0000.00717.01
8.0.140.0040.00417.02
8.0.130.0060.00013.54
8.0.120.0040.00417.02
8.0.110.0080.00017.07
8.0.100.0060.00317.03
8.0.90.0060.00317.05
8.0.80.0060.01217.21
8.0.70.0040.00417.05
8.0.60.0050.00317.16
8.0.50.0080.00017.16
8.0.30.0160.00617.55
8.0.20.0080.01217.42
8.0.10.0030.00517.33
8.0.00.0050.01316.98
7.4.330.0030.00315.11
7.4.320.0070.00016.81
7.4.300.0000.00616.78
7.4.290.0030.00316.79
7.4.280.0040.00416.91
7.4.270.0030.00316.73
7.4.260.0000.01116.88
7.4.250.0030.00616.82
7.4.240.0020.00616.73
7.4.230.0000.00716.81
7.4.220.0140.00716.79
7.4.210.0050.01016.74
7.4.200.0070.00016.69
7.4.190.0000.00716.84
7.4.160.0090.00916.79
7.4.150.0090.00917.40
7.4.140.0140.01017.86
7.4.130.0110.00816.68
7.4.120.0130.00816.80
7.4.110.0120.00616.92
7.4.100.0090.00816.75
7.4.90.0140.00616.64
7.4.80.0100.01319.39
7.4.70.0120.01316.76
7.4.60.0080.01216.84
7.4.50.0030.00316.74
7.4.40.0030.01322.77
7.4.30.0110.00516.58
7.4.00.0080.00815.04
7.3.330.0000.00513.53
7.3.320.0000.00513.68
7.3.310.0000.00716.62
7.3.300.0030.00316.49
7.3.290.0140.00016.52
7.3.280.0070.01016.53
7.3.270.0070.01117.40
7.3.260.0110.01516.54
7.3.250.0160.00616.76
7.3.240.0120.00616.71
7.3.230.0220.00016.75
7.3.210.0090.00916.70
7.3.200.0090.01219.39
7.3.190.0090.00916.66
7.3.180.0110.00716.89
7.3.170.0070.01016.48
7.3.160.0070.01016.46
7.3.120.0080.00815.10
7.3.10.0050.00516.88
7.3.00.0060.00616.67
7.2.330.0090.00917.06
7.2.320.0060.01217.04
7.2.310.0110.00716.85
7.2.300.0110.00817.04
7.2.290.0130.00416.95
7.2.130.0030.01416.99
7.2.120.0100.00717.05
7.2.110.0060.00617.13
7.2.100.0040.00417.21
7.2.90.0070.00416.97
7.2.80.0060.00917.16
7.2.70.0050.00516.84
7.2.60.0050.00917.11
7.2.50.0000.01416.91
7.2.40.0000.01316.95
7.2.30.0060.00916.61
7.2.20.0090.00616.90
7.2.10.0060.00617.04
7.2.00.0080.00817.14
7.1.250.0060.00315.77
7.1.200.0040.00716.07
7.1.70.0130.00317.10
7.1.60.0170.00719.82
7.1.50.0140.01017.20
7.1.00.0100.06722.26
7.0.200.0000.00816.88
7.0.140.0030.07322.02
7.0.60.0070.04019.96
7.0.50.0170.07717.79
7.0.40.0100.05020.28
7.0.30.0200.05720.12
7.0.20.0300.08320.10
7.0.10.0100.07720.13
7.0.00.0100.08020.35
5.6.280.0030.07321.17
5.6.210.0070.08320.63
5.6.200.0000.04318.19
5.6.190.0170.08020.52
5.6.180.0270.07320.33
5.6.170.0300.07320.47
5.6.160.0130.07720.52
5.6.150.0200.06318.18
5.6.140.0100.04718.21
5.6.130.0030.04018.21
5.6.120.0170.05021.03
5.6.110.0030.08721.03
5.6.100.0230.07021.04
5.6.90.0100.05020.98
5.6.80.0100.05320.42
5.6.70.4430.05020.39
5.5.350.0130.07720.44
5.5.340.0000.04018.05
5.5.330.0130.08020.57
5.5.320.0200.05720.30
5.5.310.0270.07720.20
5.5.300.0000.07718.04
5.5.290.0070.03717.98
5.5.280.0070.08020.69
5.5.270.0070.08720.91
5.5.260.0100.08720.88
5.5.250.0130.08020.81
5.5.240.0030.03020.10
5.4.450.0430.06719.34
5.4.440.0470.06319.49
5.4.430.0500.05719.19
5.4.420.0070.06019.57
5.4.410.0430.05719.43
5.4.400.1030.00018.62
5.4.390.0800.00018.61
5.4.380.0170.06318.52
5.4.370.0370.05018.61
5.4.360.0230.05318.52
5.4.350.0370.04718.74
5.4.340.0200.06018.52
5.4.320.0080.03412.52
5.4.310.0040.04712.52
5.4.300.0070.04012.52
5.4.290.0100.04112.51
5.4.280.0040.04012.41
5.4.270.0060.03812.41
5.4.260.0200.04019.09
5.4.250.0130.04718.95
5.4.240.0130.05018.98
5.4.230.0100.05019.06
5.4.220.0170.05018.94
5.4.210.0170.05718.96
5.4.200.0030.05718.90
5.4.190.0130.07318.64
5.4.180.0210.05019.06
5.4.170.0070.05719.04
5.4.160.0070.05318.89
5.4.150.0100.05318.93
5.4.140.0030.05716.59
5.4.130.0130.04716.40
5.4.120.0230.06016.49
5.4.110.0170.05016.45
5.4.100.0170.05316.67
5.4.90.0100.05316.55
5.4.80.0070.05016.61
5.4.70.0100.05016.51
5.4.60.0070.07016.39
5.4.50.0030.05316.63
5.4.40.0030.05316.64
5.4.30.0030.05316.63
5.4.20.0100.07016.39
5.4.10.0170.06316.45
5.4.00.0030.05015.86
5.3.290.0070.03812.80
5.3.280.0100.05014.68
5.3.270.0160.05414.69
5.3.260.0100.05314.64
5.3.250.0100.07014.76
5.3.240.0130.06714.79
5.3.230.0170.04014.61
5.3.220.0070.06014.56
5.3.210.0270.04014.42
5.3.200.0170.04314.65
5.3.190.0070.07014.61
5.3.180.0070.05714.75
5.3.170.0100.05014.81
5.3.160.0100.04714.61
5.3.150.0100.05014.75
5.3.140.0170.05014.41
5.3.130.0200.07314.66
5.3.120.0030.06014.50
5.3.110.0100.07714.65
5.3.100.0070.05014.14
5.3.90.0070.04714.22
5.3.80.0100.04714.11
5.3.70.0030.05313.94
5.3.60.0100.04714.00
5.3.50.0100.04313.87
5.3.40.0100.04713.80
5.3.30.0100.04713.91
5.3.20.0100.04313.80
5.3.10.0030.05013.65
5.3.00.0070.05013.49
5.2.170.0070.04011.25
5.2.160.0130.05311.07
5.2.150.0000.04711.25
5.2.140.0000.04311.14
5.2.130.0070.05311.20
5.2.120.0030.04011.03
5.2.110.0030.04011.21
5.2.100.0070.03711.20
5.2.90.0070.03711.29
5.2.80.0070.04011.34
5.2.70.0200.03311.20
5.2.60.0130.03711.24
5.2.50.0070.05311.13
5.2.40.0070.04011.10
5.2.30.0170.05011.09
5.2.20.0030.04010.90
5.2.10.0070.03711.05
5.2.00.0030.04310.72
5.1.60.0000.03710.09
5.1.50.0070.03710.09
5.1.40.0100.03010.10
5.1.30.0030.03710.58
5.1.20.0000.05310.46
5.1.10.0030.05310.20
5.1.00.0030.05710.19
5.0.50.0100.0338.55
5.0.40.0030.0378.51
5.0.30.0070.0478.33
5.0.20.0030.0278.18
5.0.10.0070.0278.13
5.0.00.0030.0578.28
4.4.90.0030.0206.38
4.4.80.0030.0306.38
4.4.70.0000.0276.38
4.4.60.0030.0236.38
4.4.50.0030.0206.38
4.4.40.0030.0336.38
4.4.30.0030.0236.38
4.4.20.0070.0306.38
4.4.10.0030.0276.38
4.4.00.0030.0406.38
4.3.110.0030.0206.38
4.3.100.0070.0176.38
4.3.90.0000.0236.38
4.3.80.0030.0306.38
4.3.70.0000.0236.38
4.3.60.0030.0176.38
4.3.50.0070.0176.38
4.3.40.0000.0336.38
4.3.30.0000.0236.38
4.3.20.0000.0276.38
4.3.10.0030.0306.38
4.3.00.0000.0236.84

preferences:
64.48 ms | 401 KiB | 5 Q