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() { $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) { 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"') { return "<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 { return 'dhoaudg od oaeywgdoad <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_num => $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.0120.00618.43
8.3.50.0100.01022.11
8.3.40.0150.00319.21
8.3.30.0150.00019.35
8.3.20.0070.00020.39
8.3.10.0000.00821.96
8.3.00.0040.00422.22
8.2.180.0120.00616.75
8.2.170.0070.00722.96
8.2.160.0080.00619.37
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00819.49
8.2.110.0060.00322.55
8.2.100.0120.00019.89
8.2.90.0040.00419.30
8.2.80.0000.00818.04
8.2.70.0030.00618.00
8.2.60.0080.00017.80
8.2.50.0090.00018.07
8.2.40.0040.00418.07
8.2.30.0000.00718.23
8.2.20.0050.00317.87
8.2.10.0050.00317.93
8.2.00.0040.00418.08
8.1.280.0110.00425.92
8.1.270.0000.00822.18
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0060.00619.27
8.1.220.0050.00317.77
8.1.210.0080.00018.77
8.1.200.0040.00717.73
8.1.190.0000.00817.65
8.1.180.0000.00818.89
8.1.170.0030.00518.89
8.1.160.0000.00822.07
8.1.150.0000.00818.72
8.1.140.0000.00817.61
8.1.130.0030.00317.91
8.1.120.0070.00017.68
8.1.110.0070.00017.64
8.1.100.0000.00717.61
8.1.90.0000.00817.66
8.1.80.0040.00417.75
8.1.70.0000.00717.66
8.1.60.0030.00717.82
8.1.50.0040.00417.71
8.1.40.0000.00817.78
8.1.30.0040.00417.82
8.1.20.0000.00917.87
8.1.10.0040.00417.65
8.1.00.0000.00817.74
8.0.300.0040.00418.77
8.0.290.0050.00317.17
8.0.280.0030.00318.56
8.0.270.0030.00517.41
8.0.260.0000.00717.13
8.0.250.0050.00217.28
8.0.240.0040.00417.20
8.0.230.0000.00717.21
8.0.220.0020.00517.09
8.0.210.0030.00317.08
8.0.200.0040.00417.21
8.0.190.0040.00417.27
8.0.180.0000.00817.20
8.0.170.0040.00417.18
8.0.160.0040.00417.04
8.0.150.0070.00017.21
8.0.140.0070.00017.13
8.0.130.0000.00613.57
8.0.120.0040.00417.17
8.0.110.0080.00017.19
8.0.100.0000.00717.17
8.0.90.0080.00017.22
8.0.80.0060.01317.21
8.0.70.0040.00417.04
8.0.60.0000.00817.23
8.0.50.0040.00417.04
8.0.30.0090.01117.31
8.0.20.0090.01117.40
8.0.10.0000.00717.35
8.0.00.0090.01016.95
7.4.330.0050.00015.11
7.4.320.0030.00316.91
7.4.300.0060.00016.68
7.4.290.0030.00316.83
7.4.280.0040.00416.72
7.4.270.0000.00716.69
7.4.260.0000.00716.85
7.4.250.0080.00016.83
7.4.240.0020.00616.83
7.4.230.0030.00316.87
7.4.220.0140.00316.90
7.4.210.0060.01016.82
7.4.200.0080.00016.62
7.4.190.0040.00416.96
7.4.160.0070.01016.84
7.4.150.0180.00017.40
7.4.140.0130.00517.86
7.4.130.0080.01116.82
7.4.120.0130.00816.74
7.4.110.0140.00516.91
7.4.100.0120.00616.75
7.4.90.0080.01216.73
7.4.80.0100.00719.39
7.4.70.0080.01216.76
7.4.60.0070.01616.96
7.4.50.0060.00316.80
7.4.40.0110.00022.77
7.4.30.0120.00616.79
7.4.00.0030.01215.21
7.3.330.0000.00613.62
7.3.320.0000.00613.45
7.3.310.0070.00016.50
7.3.300.0000.00716.47
7.3.290.0060.00916.49
7.3.280.0080.00816.56
7.3.270.0100.01617.40
7.3.260.0180.00416.64
7.3.250.0120.00716.87
7.3.240.0090.00916.91
7.3.230.0070.01816.69
7.3.210.0140.00616.52
7.3.200.0110.01119.39
7.3.190.0100.01316.60
7.3.180.0110.00616.77
7.3.170.0060.01216.79
7.3.160.0080.00816.58
7.3.120.0060.00915.00
7.2.330.0100.00816.74
7.2.320.0120.01217.09
7.2.310.0100.01016.93
7.2.300.0120.00616.91
7.2.290.0060.01216.85
7.1.70.0090.00317.28
7.1.60.0150.00619.82
7.1.50.0100.01317.00
7.1.00.0030.07022.42
7.0.200.0080.00416.91
7.0.140.0100.06722.09
7.0.60.0130.08019.91
7.0.50.0100.07717.86
7.0.40.0070.08320.07
7.0.30.0330.07320.15
7.0.20.0170.05320.23
7.0.10.0200.04020.40
7.0.00.0130.05320.28
5.6.280.0100.06721.09
5.6.210.0170.07020.56
5.6.200.0070.08018.22
5.6.190.0100.04720.77
5.6.180.2830.03720.46
5.6.170.0200.04720.51
5.6.160.0130.07020.54
5.6.150.0100.04018.19
5.6.140.0030.06718.22
5.6.130.0170.06718.15
5.6.120.0130.07721.01
5.6.110.0070.08321.13
5.6.100.0100.08021.02
5.6.90.0100.08721.00
5.6.80.0070.06320.41
5.6.70.4470.03320.39
5.5.350.0170.03320.48
5.5.340.0100.08018.08
5.5.330.0030.09320.35
5.5.320.0270.05320.42
5.5.310.0470.06320.25
5.5.300.0030.04017.98
5.5.290.0030.06317.94
5.5.280.0100.07020.91
5.5.270.0130.07720.66
5.5.260.0070.07720.66
5.5.250.0100.08320.71
5.5.240.0100.08020.30
5.4.450.0230.07719.59
5.4.440.0230.05719.32
5.4.430.0230.06019.17
5.4.420.0230.04319.34
5.4.410.0430.06319.11
5.4.400.0230.04319.09
5.4.390.0300.04018.85
5.4.380.0200.07319.15
5.4.370.0200.06718.88
5.4.360.0230.07019.31
5.4.350.0230.05319.16
5.4.340.0270.04718.87
5.4.320.0230.06319.22
5.4.310.0200.06719.08
5.4.300.0170.05019.06
5.4.290.0100.04019.31
5.4.280.0200.03319.13
5.4.270.0200.04019.21
5.4.260.0130.04019.09
5.4.250.0100.04019.04
5.4.240.0130.03719.08
5.4.230.0170.03718.98
5.4.220.0130.03719.00
5.4.210.0070.04318.86
5.4.200.0200.03318.98
5.4.190.0130.03719.12
5.4.180.0200.03019.23
5.4.170.0230.02719.25
5.4.160.0200.03718.93
5.4.150.0100.04018.98
5.4.140.0230.03016.41
5.4.130.0100.04016.36
5.4.120.0170.03716.73
5.4.110.0100.03716.29
5.4.100.0170.03316.46
5.4.90.0130.03316.61
5.4.80.0170.03316.62
5.4.70.0130.03716.57
5.4.60.0100.04016.43
5.4.50.0200.04316.43
5.4.40.0200.05316.43
5.4.30.0230.06016.52
5.4.20.0270.07316.43
5.4.10.0230.07016.54
5.4.00.0270.05716.12
5.3.290.0230.07714.85
5.3.280.0170.03714.62
5.3.270.0130.04014.68
5.3.260.0130.03714.64
5.3.250.0200.03314.74
5.3.240.0170.03314.70
5.3.230.0130.03714.61
5.3.220.0130.03714.64
5.3.210.0130.03714.57
5.3.200.0170.03314.75
5.3.190.0170.03314.81
5.3.180.0130.03714.66
5.3.170.0170.03714.66
5.3.160.0200.03014.58
5.3.150.0200.03014.50
5.3.140.0200.07314.63
5.3.130.0170.06714.67
5.3.120.0370.07014.48
5.3.110.0200.06014.55
5.3.100.0270.05014.28
5.3.90.0270.06314.11
5.3.80.0170.04714.26
5.3.70.0300.06013.97
5.3.60.0270.06713.95
5.3.50.0230.05713.89
5.3.40.0270.06713.99
5.3.30.0270.06013.84
5.3.20.0300.06313.65
5.3.10.0270.06313.59
5.3.00.0270.05313.75
5.2.170.0230.04712.00
5.2.160.0170.04012.00
5.2.150.0230.06012.00
5.2.140.0200.05012.00
5.2.130.0270.03712.00
5.2.120.0200.04012.00
5.2.110.0170.03712.00
5.2.100.0170.04312.00
5.2.90.0170.04012.00
5.2.80.0270.05012.00
5.2.70.0200.06012.00
5.2.60.0170.06012.00
5.2.50.0200.05712.00
5.2.40.0130.04712.00
5.2.30.0200.06012.00
5.2.20.0170.05712.00
5.2.10.0170.05712.00
5.2.00.0300.04712.00
5.1.60.0200.03712.00
5.1.50.0170.05312.00
5.1.40.0200.05012.00
5.1.30.0170.05712.00
5.1.20.0170.04712.00
5.1.10.0300.04312.00
5.1.00.0230.04312.00
5.0.50.0100.04012.00
5.0.40.0130.03012.00
5.0.30.0100.04712.00
5.0.20.0170.02712.00
5.0.10.0100.04012.00
5.0.00.0130.06012.00
4.4.90.0030.02712.00
4.4.80.0070.03712.00
4.4.70.0070.03712.00
4.4.60.0100.03012.00
4.4.50.0100.02712.00
4.4.40.0100.04012.00
4.4.30.0100.03312.00
4.4.20.0070.03312.00
4.4.10.0070.03712.00
4.4.00.0100.04712.00
4.3.110.0070.02712.00
4.3.100.0100.02712.00
4.3.90.0100.01312.00
4.3.80.0100.03712.00
4.3.70.0100.03012.00
4.3.60.0070.02712.00
4.3.50.0070.03012.00
4.3.40.0070.04712.00
4.3.30.0100.02712.00
4.3.20.0030.04012.00
4.3.10.0030.03012.00
4.3.00.0070.03012.00

preferences:
39.71 ms | 401 KiB | 5 Q