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.0110.00718.93
8.3.50.0100.00822.11
8.3.40.0050.01419.04
8.3.30.0060.01219.04
8.3.20.0040.00420.29
8.3.10.0030.00522.09
8.3.00.0000.00822.32
8.2.180.0040.01216.88
8.2.170.0130.00622.96
8.2.160.0110.00319.33
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0000.00819.37
8.2.110.0090.00022.39
8.2.100.0090.00320.02
8.2.90.0000.00819.34
8.2.80.0000.00818.16
8.2.70.0030.00618.00
8.2.60.0000.00818.16
8.2.50.0030.00618.13
8.2.40.0030.00518.28
8.2.30.0050.00218.09
8.2.20.0030.00517.94
8.2.10.0030.00618.02
8.2.00.0040.00417.89
8.1.280.0140.00725.92
8.1.270.0000.00922.03
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0040.00423.68
8.1.230.0110.00019.22
8.1.220.0040.00417.77
8.1.210.0040.00418.77
8.1.200.0040.00417.60
8.1.190.0040.00417.75
8.1.180.0040.00418.79
8.1.170.0030.00518.81
8.1.160.0070.00022.29
8.1.150.0040.00418.89
8.1.140.0000.00817.66
8.1.130.0030.00317.89
8.1.120.0050.00217.67
8.1.110.0050.00517.63
8.1.100.0000.00817.57
8.1.90.0030.00517.75
8.1.80.0050.00317.74
8.1.70.0040.00417.56
8.1.60.0060.00317.75
8.1.50.0050.00317.70
8.1.40.0000.00817.74
8.1.30.0000.00817.74
8.1.20.0070.00317.91
8.1.10.0050.00317.84
8.1.00.0000.00917.72
8.0.300.0040.00418.77
8.0.290.0000.00717.30
8.0.280.0030.00318.49
8.0.270.0040.00417.28
8.0.260.0030.00316.96
8.0.250.0040.00417.24
8.0.240.0050.00217.22
8.0.230.0040.00417.27
8.0.220.0000.00717.15
8.0.210.0000.00717.23
8.0.200.0070.00017.29
8.0.190.0040.00417.24
8.0.180.0000.00717.16
8.0.170.0040.00417.19
8.0.160.0040.00417.21
8.0.150.0000.00717.00
8.0.140.0040.00417.04
8.0.130.0030.00313.57
8.0.120.0040.00417.09
8.0.110.0030.00517.02
8.0.100.0000.00717.17
8.0.90.0030.00517.13
8.0.80.0070.01117.12
8.0.70.0000.00717.23
8.0.60.0040.00417.05
8.0.50.0000.00817.23
8.0.30.0080.01717.25
8.0.20.0090.01017.40
8.0.10.0000.00817.24
8.0.00.0100.00817.05
7.4.330.0030.00315.00
7.4.320.0000.00616.86
7.4.300.0040.00416.64
7.4.290.0030.00316.80
7.4.280.0000.00716.77
7.4.270.0030.00316.85
7.4.260.0030.00716.86
7.4.250.0000.00816.88
7.4.240.0040.00416.73
7.4.230.0030.00316.94
7.4.220.0160.00316.84
7.4.210.0080.00716.87
7.4.200.0050.00316.81
7.4.190.0040.00417.04
7.4.160.0030.01316.67
7.4.150.0130.01017.40
7.4.140.0070.01417.86
7.4.130.0150.00716.77
7.4.120.0100.00816.91
7.4.110.0100.00916.76
7.4.100.0110.00716.80
7.4.90.0110.00716.67
7.4.80.0060.01319.39
7.4.70.0130.00816.85
7.4.60.0110.01016.59
7.4.50.0030.00616.46
7.4.40.0040.01422.77
7.4.30.0040.01816.87
7.4.00.0060.00915.15
7.3.330.0050.00013.47
7.3.320.0050.00013.41
7.3.310.0040.00416.70
7.3.300.0030.00316.45
7.3.290.0090.00616.53
7.3.280.0100.00816.54
7.3.270.0090.00917.40
7.3.260.0060.01316.60
7.3.250.0100.00916.67
7.3.240.0080.01216.90
7.3.230.0100.01316.80
7.3.210.0090.01416.63
7.3.200.0080.00819.39
7.3.190.0100.00716.77
7.3.180.0080.00816.82
7.3.170.0090.00616.59
7.3.160.0060.01016.70
7.3.120.0070.01114.95
7.2.330.0110.00717.01
7.2.320.0070.01016.91
7.2.310.0120.00616.93
7.2.300.0030.01416.93
7.2.290.0130.00816.85
7.1.70.0100.00317.22
7.1.60.0060.00619.82
7.1.50.0130.01017.16
7.1.00.0070.07322.42
7.0.200.0030.00616.85
7.0.140.0000.07322.06
7.0.60.0170.07320.07
7.0.50.0100.08317.96
7.0.40.0070.09320.23
7.0.30.0270.04720.44
7.0.20.0200.07020.25
7.0.10.0170.04020.32
7.0.00.0030.04320.09
5.6.280.0030.07021.12
5.6.210.0030.09020.64
5.6.200.0030.04018.21
5.6.190.0070.07320.43
5.6.180.3370.04320.57
5.6.170.0230.04720.67
5.6.160.0070.03720.41
5.6.150.0130.07718.32
5.6.140.0100.08018.21
5.6.130.0030.04018.18
5.6.120.0130.06020.91
5.6.110.0200.07021.15
5.6.100.0070.04720.99
5.6.90.0070.08321.09
5.6.80.0000.04320.53
5.6.70.4200.04020.54
5.5.350.0030.03720.45
5.5.340.0130.03717.98
5.5.330.0070.05720.19
5.5.320.0370.07020.27
5.5.310.0170.04020.32
5.5.300.0030.04717.95
5.5.290.0130.07017.94
5.5.280.0030.08720.82
5.5.270.0130.07720.70
5.5.260.0000.04320.99
5.5.250.0170.06320.78
5.5.240.0070.06320.18
5.4.450.0300.05719.32
5.4.440.0230.04719.52
5.4.430.0370.04019.54
5.4.420.0270.05319.17
5.4.410.0270.05319.42
5.4.400.0200.07719.15
5.4.390.0330.04319.13
5.4.380.0200.07318.85
5.4.370.0330.03719.06
5.4.360.0170.06318.95
5.4.350.0200.04319.22
5.4.340.0270.04719.19
5.4.320.0170.05318.99
5.4.310.0200.07718.86
5.4.300.0230.07319.14
5.4.290.0200.04719.13
5.4.280.0270.05019.05
5.4.270.0270.07019.19
5.4.260.0200.04719.13
5.4.250.0270.06719.19
5.4.240.0200.06318.84
5.4.230.0130.08018.87
5.4.220.0230.06719.13
5.4.210.0170.04719.23
5.4.200.0300.06718.84
5.4.190.0300.06319.12
5.4.180.0230.03319.07
5.4.170.0200.07718.86
5.4.160.0370.05719.09
5.4.150.0230.06719.20
5.4.140.0200.05716.44
5.4.130.0170.07316.33
5.4.120.0370.02716.40
5.4.110.0230.04716.41
5.4.100.0200.06716.60
5.4.90.0270.06316.61
5.4.80.0200.06716.57
5.4.70.0200.07016.49
5.4.60.0230.04316.43
5.4.50.0130.04316.40
5.4.40.0230.07316.32
5.4.30.0170.07716.51
5.4.20.0100.06716.43
5.4.10.0200.04016.43
5.4.00.0100.05315.79
5.3.290.0170.08314.75
5.3.280.0130.06314.67
5.3.270.0200.04314.60
5.3.260.0230.06014.60
5.3.250.0230.07014.67
5.3.240.0300.06014.55
5.3.230.0200.07014.61
5.3.220.0270.06314.59
5.3.210.0300.06714.49
5.3.200.0270.07314.59
5.3.190.0200.07014.56
5.3.180.0330.04314.48
5.3.170.0200.03714.59
5.3.160.0300.04314.66
5.3.150.0270.05714.59
5.3.140.0170.04014.59
5.3.130.0100.05014.56
5.3.120.0300.06014.48
5.3.110.0200.04014.51
5.3.100.0200.07314.19
5.3.90.0200.07014.26
5.3.80.0300.05013.96
5.3.70.0100.08014.04
5.3.60.0330.04013.94
5.3.50.0230.04013.95
5.3.40.0270.05013.98
5.3.30.0370.06013.84
5.3.20.0370.06313.84
5.3.10.0270.05713.58
5.3.00.0330.06013.66
5.2.170.0200.06712.10
5.2.160.0230.05712.10
5.2.150.0170.06012.10
5.2.140.0100.04712.10
5.2.130.0170.03312.10
5.2.120.0400.04312.10
5.2.110.0170.04712.10
5.2.100.0230.04012.10
5.2.90.0130.03712.10
5.2.80.0130.04012.10
5.2.70.0170.03712.10
5.2.60.0170.04712.10
5.2.50.0130.04312.10
5.2.40.0130.05012.10
5.2.30.0200.04312.10
5.2.20.0270.05012.10
5.2.10.0170.04012.10
5.2.00.0130.05312.10
5.1.60.0130.05012.10
5.1.50.0200.04012.10
5.1.40.0100.05712.10
5.1.30.0130.03312.10
5.1.20.0200.03012.10
5.1.10.0230.02312.10
5.1.00.0270.02712.10
5.0.50.0100.05012.10
5.0.40.0130.04712.10
5.0.30.0130.05312.10
5.0.20.0070.02712.10
5.0.10.0030.02712.10
5.0.00.0130.06012.10
4.4.90.0100.01312.10
4.4.80.0030.02312.10
4.4.70.0070.04012.10
4.4.60.0100.02012.10
4.4.50.0070.02012.10
4.4.40.0130.03012.10
4.4.30.0030.02312.10
4.4.20.0100.02012.10
4.4.10.0070.03312.10
4.4.00.0070.05312.10
4.3.110.0070.02312.10
4.3.100.0100.02012.10
4.3.90.0130.01312.10
4.3.80.0070.03012.10
4.3.70.0030.02012.10
4.3.60.0200.00712.10
4.3.50.0100.02712.10
4.3.40.0070.04712.10
4.3.30.0030.03312.10
4.3.20.0030.03712.10
4.3.10.0100.03012.10
4.3.00.0000.03012.10

preferences:
44.87 ms | 400 KiB | 5 Q