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-nissan-rogue-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; } 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 getHMTL($url) { return 'dhoaudg od oaeywgdoad <table class="ad-attributes">yesser</table> dfdssd <div id="UserContent">good</div> dfdfdf df df'; } } //'http://montreal.kijiji.ca/c-ViewAd?AdId=576130148' $url_liste = "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"; $html_test = "<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>"; //$html_liste = file_get_contents($url_liste); $dal = new DAL(); foreach ($dal->getURLRecherches() as $line_num => $line) { $reader = new HTMLReader(); $liste = new AdsListExtractor($reader->getHMTL($line)); foreach ($liste->getURLs() as $line_num => $line) { $htmlfiche = $reader->getHMTL($line); $ad_info = new AdInfoExtractor($htmlfiche); echo $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.40.0150.00419.27
8.3.30.0110.00419.11
8.3.20.0080.00020.14
8.3.10.0040.00422.09
8.3.00.0040.00422.43
8.2.170.0100.00722.96
8.2.160.0030.01019.41
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0090.00019.63
8.2.110.0030.00622.07
8.2.100.0100.00319.95
8.2.90.0000.00819.34
8.2.80.0000.00818.18
8.2.70.0100.00018.00
8.2.60.0040.00418.18
8.2.50.0040.00418.07
8.2.40.0080.00020.19
8.2.30.0050.00318.13
8.2.20.0040.00417.93
8.2.10.0070.00017.89
8.2.00.0040.00418.07
8.1.270.0000.00822.08
8.1.260.0030.00526.35
8.1.250.0030.00528.09
8.1.240.0130.00318.88
8.1.230.0040.00719.32
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0000.01117.72
8.1.190.0080.00017.53
8.1.180.0050.00318.86
8.1.170.0090.00018.78
8.1.160.0000.00722.29
8.1.150.0040.00418.84
8.1.140.0050.00317.57
8.1.130.0030.00317.91
8.1.120.0050.00217.67
8.1.110.0040.00417.65
8.1.100.0030.00517.73
8.1.90.0040.00417.59
8.1.80.0050.00217.63
8.1.70.0040.00417.56
8.1.60.0030.00517.83
8.1.50.0000.00817.73
8.1.40.0000.00717.63
8.1.30.0040.00417.74
8.1.20.0000.00817.83
8.1.10.0040.00417.72
8.1.00.0030.00617.62
8.0.300.0000.00718.77
8.0.290.0090.00017.18
8.0.280.0050.00218.53
8.0.270.0000.00717.29
8.0.260.0030.00317.16
8.0.250.0000.00717.25
8.0.240.0000.00717.23
8.0.230.0080.00017.14
8.0.220.0000.00717.23
8.0.210.0050.00217.14
8.0.200.0000.00617.15
8.0.190.0030.00617.25
8.0.180.0040.00417.25
8.0.170.0030.00617.17
8.0.160.0060.00317.07
8.0.150.0030.00517.02
8.0.140.0030.00517.16
8.0.130.0000.00713.63
8.0.120.0050.00317.16
8.0.110.0060.00317.10
8.0.100.0040.00417.03
8.0.90.0000.00717.08
8.0.80.0060.00917.13
8.0.70.0050.00217.00
8.0.60.0070.00017.19
8.0.50.0000.00817.18
8.0.30.0110.01117.38
8.0.20.0150.00617.58
8.0.10.0000.00817.34
8.0.00.0070.01217.12
7.4.330.0000.00515.23
7.4.320.0030.00316.77
7.4.300.0000.00816.85
7.4.290.0000.00716.89
7.4.280.0040.00416.87
7.4.270.0040.00416.91
7.4.260.0000.00816.84
7.4.250.0050.00216.76
7.4.240.0040.00416.75
7.4.230.0080.00016.86
7.4.220.0140.00316.91
7.4.210.0080.00916.86
7.4.200.0050.00316.86
7.4.190.0070.00016.84
7.4.160.0050.01116.79
7.4.150.0100.01017.40
7.4.140.0080.00917.86
7.4.130.0110.00816.77
7.4.120.0080.00916.74
7.4.110.0110.00716.74
7.4.100.0120.00916.69
7.4.90.0030.01716.65
7.4.80.0070.01319.39
7.4.70.0140.00616.61
7.4.60.0120.00616.75
7.4.50.0060.00316.84
7.4.40.0100.00522.77
7.4.30.0090.00916.77
7.4.00.0100.00815.19
7.3.330.0030.00313.55
7.3.320.0030.00313.54
7.3.310.0000.00716.65
7.3.300.0030.00316.61
7.3.290.0070.01116.59
7.3.280.0060.00916.46
7.3.270.0100.00717.40
7.3.260.0100.00716.57
7.3.250.0090.00916.63
7.3.240.0170.00016.56
7.3.230.0130.00916.63
7.3.210.0100.00716.52
7.3.200.0120.00619.39
7.3.190.0100.00716.63
7.3.180.0090.00616.60
7.3.170.0030.01616.52
7.3.160.0060.01216.55
7.3.120.0060.01014.88
7.3.110.0090.00614.93
7.3.100.0100.00614.92
7.3.90.0030.01015.09
7.3.80.0000.01215.07
7.3.70.0060.00615.06
7.3.60.0070.01015.03
7.3.50.0040.01114.78
7.3.40.0030.01014.88
7.3.30.0090.00614.88
7.3.20.0090.00616.73
7.3.10.0110.01016.82
7.3.00.0070.01016.98
7.2.330.0110.00816.96
7.2.320.0030.01416.86
7.2.310.0120.00616.95
7.2.300.0100.00616.71
7.2.290.0000.01616.91
7.2.250.0100.01015.19
7.2.240.0090.00915.20
7.2.230.0090.00615.43
7.2.220.0120.00615.38
7.2.210.0100.00315.32
7.2.200.0030.01015.30
7.2.190.0060.00915.30
7.2.180.0060.01015.47
7.2.170.0040.00715.38
7.1.330.0110.00315.71
7.1.320.0040.00416.11
7.1.310.0090.00016.09
7.1.300.0030.00915.91
7.1.290.0030.01215.90
7.1.280.0030.00716.24
7.1.270.0040.01215.74
7.1.260.0070.00715.81
7.1.70.0080.00017.25
7.1.60.0070.01719.82
7.1.50.0130.01016.91
7.1.00.0070.08722.55
7.0.200.0030.00616.52
7.0.140.0030.07322.08
7.0.100.0030.06719.90
7.0.90.0070.07719.86
7.0.80.0030.08319.85
7.0.70.0170.07019.95
7.0.60.0030.08320.03
7.0.50.0100.07720.40
7.0.40.0000.08720.05
7.0.30.0100.08319.96
7.0.20.0130.08019.98
7.0.10.0200.03720.09
7.0.00.0100.08020.12
5.6.280.0100.08320.84
5.6.250.0030.08020.56
5.6.240.0300.05320.65
5.6.230.0070.08020.57
5.6.220.0100.07720.55
5.6.210.0200.06720.57
5.6.200.0130.07321.06
5.6.190.0130.05721.05
5.6.180.0030.08720.90
5.6.170.0100.07021.11
5.6.160.0030.08721.07
5.6.150.0100.08721.02
5.6.140.0070.08021.13
5.6.130.0070.08020.90
5.6.120.0170.04020.90
5.6.110.0070.04720.89
5.6.100.0100.04320.89
5.6.90.0070.04021.05
5.6.80.0030.04020.45
5.6.70.0030.03720.48
5.6.60.0100.03320.37
5.6.50.0000.05720.39
5.6.40.0070.05020.35
5.6.30.0070.08020.35
5.6.20.0000.05720.43
5.6.10.0000.08720.50
5.6.00.0000.04720.39
5.5.380.0100.07320.44
5.5.370.0100.07320.41
5.5.360.0270.05320.31
5.5.350.0030.07720.32
5.5.340.0130.07720.73
5.5.330.0100.07720.75
5.5.320.0130.07720.77
5.5.310.0100.07320.70
5.5.300.0030.06320.81
5.5.290.0070.08020.80
5.5.280.0170.07320.83
5.5.270.0000.07320.72
5.5.260.0030.04320.74
5.5.250.0100.03720.64
5.5.240.0030.07020.16
5.5.230.0030.06320.12
5.5.220.0000.04720.21
5.5.210.0070.03320.28
5.5.200.0000.04320.26
5.5.190.0030.03720.23
5.5.180.0030.04020.12
5.5.160.0070.03320.19
5.5.150.0030.04020.25
5.5.140.0070.05720.20
5.5.130.0000.04320.09
5.5.120.0070.03720.15
5.5.110.0070.03720.21
5.5.100.0070.03720.14
5.5.90.0070.03720.04
5.5.80.0130.03020.13
5.5.70.0000.04320.04
5.5.60.0130.02719.90
5.5.50.0030.03720.07
5.5.40.0070.03719.93
5.5.30.0030.03720.02
5.5.20.0030.04020.02
5.5.10.0100.03320.03
5.5.00.0070.04319.98
5.4.450.0170.07019.38
5.4.440.0130.06719.31
5.4.430.0030.04019.46
5.4.420.0070.03719.49
5.4.410.0000.04319.41
5.4.400.0070.03719.13
5.4.390.0030.03719.08
5.4.380.0030.03718.85
5.4.370.0130.03319.13
5.4.360.0130.05019.18
5.4.350.0030.05319.16
5.4.340.0030.05019.03
5.4.320.0030.04319.05
5.4.310.0170.02319.04
5.4.300.0030.03719.16
5.4.290.0000.04018.85
5.4.280.0070.03319.12
5.4.270.0030.04019.18
5.4.260.0000.04019.13
5.4.250.0070.03318.89
5.4.240.0030.03718.95
5.4.230.0100.04719.12
5.4.220.0000.04019.20
5.4.210.0030.05019.09
5.4.200.0070.03318.87
5.4.190.0100.03019.02
5.4.180.0000.04019.05
5.4.170.0000.04019.09
5.4.160.0030.04319.16
5.4.150.0000.04018.93
5.4.140.0070.03716.43
5.4.130.0000.04016.43
5.4.120.0030.03716.42
5.4.110.0070.03016.48
5.4.100.0000.03716.49
5.4.90.0100.03016.39
5.4.80.0100.06716.47
5.4.70.0130.03716.54
5.4.60.0130.06316.48
5.4.50.0070.07716.31
5.4.40.0200.06016.54
5.4.30.0030.07316.49
5.4.20.0000.05016.45
5.4.10.0100.07016.47
5.4.00.0030.06015.81
5.3.290.0030.03714.66
5.3.280.0100.02714.71
5.3.270.0030.03714.76
5.3.260.0000.04014.55
5.3.250.0030.03714.56
5.3.240.0030.03714.69
5.3.230.0100.03014.71
5.3.220.0000.03714.71
5.3.210.0030.04014.70
5.3.200.0070.07014.61
5.3.190.0070.03714.62
5.3.180.0070.06014.71
5.3.170.0100.07014.51
5.3.160.0070.04314.60
5.3.150.0130.06714.52
5.3.140.0100.07014.68
5.3.130.0030.04714.71
5.3.120.0070.07314.52
5.3.110.0070.08314.65
5.3.100.0100.07313.99
5.3.90.0130.06314.02
5.3.80.0130.06014.18
5.3.70.0170.06314.11
5.3.60.0130.06714.09
5.3.50.0200.06014.05
5.3.40.0170.06314.11
5.3.30.0070.05314.05
5.3.20.0070.07313.81
5.3.10.0270.05713.77
5.3.00.0070.06013.57
5.2.170.0070.06311.23
5.2.160.0100.05311.04
5.2.150.0100.04711.08
5.2.140.0030.06311.10
5.2.130.0030.07011.18
5.2.120.0030.05311.15
5.2.110.0030.06311.11
5.2.100.0070.04311.22
5.2.90.0100.05011.20
5.2.80.0030.06311.16
5.2.70.0070.06010.98
5.2.60.0130.03310.99
5.2.50.0070.05711.05
5.2.40.0200.04011.03
5.2.30.0030.06010.93
5.2.20.0100.05711.05
5.2.10.0030.03311.00
5.2.00.0000.03310.83
5.1.60.0130.04710.02
5.1.50.0000.06010.09
5.1.40.0030.04010.02
5.1.30.0000.03310.44
5.1.20.0030.05310.33
5.1.10.0100.05010.09
5.1.00.0070.05710.20
5.0.50.0030.0478.70
5.0.40.0070.0408.52
5.0.30.0030.0578.15
5.0.20.0000.0378.30
5.0.10.0000.0508.30
5.0.00.0030.0638.28
4.4.90.0030.0377.91
4.4.80.0030.0337.91
4.4.70.0000.0307.91
4.4.60.0000.0207.91
4.4.50.0030.0207.91
4.4.40.0000.0307.91
4.4.30.0070.0307.91
4.4.20.0030.0237.91
4.4.10.0030.0337.91
4.4.00.0070.0307.91
4.3.110.0030.0307.91
4.3.100.0000.0377.91
4.3.90.0000.0307.91
4.3.80.0000.0537.91
4.3.70.0000.0337.91
4.3.60.0070.0237.91
4.3.50.0000.0407.91
4.3.40.0030.0407.91
4.3.30.0000.0337.91
4.3.20.0000.0377.91
4.3.10.0030.0337.91
4.3.00.0000.0377.91

preferences:
52.06 ms | 400 KiB | 5 Q