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-nissan-rogue-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 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) { echo $line; echo "\n"; $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.60.0120.00618.43
8.3.50.0110.00722.05
8.3.40.0110.00419.04
8.3.30.0090.00919.21
8.3.20.0040.00420.39
8.3.10.0030.00621.92
8.3.00.0040.00422.42
8.2.180.0120.00316.75
8.2.170.0070.00722.96
8.2.160.0110.00319.38
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.96
8.2.110.0030.00622.39
8.2.100.0000.01219.82
8.2.90.0030.00619.35
8.2.80.0040.00417.97
8.2.70.0060.00318.00
8.2.60.0000.00817.93
8.2.50.0060.00318.07
8.2.40.0000.00818.34
8.2.30.0070.00018.09
8.2.20.0040.00417.96
8.2.10.0040.00417.95
8.2.00.0040.00417.84
8.1.280.0110.00425.92
8.1.270.0040.00422.15
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0000.00823.92
8.1.230.0060.00619.24
8.1.220.0050.00317.91
8.1.210.0000.00818.77
8.1.200.0000.01217.60
8.1.190.0040.00417.66
8.1.180.0000.00818.66
8.1.170.0000.00818.83
8.1.160.0000.00722.21
8.1.150.0070.00018.78
8.1.140.0040.00417.66
8.1.130.0070.00017.79
8.1.120.0040.00417.65
8.1.110.0000.00917.51
8.1.100.0000.00717.64
8.1.90.0040.00417.63
8.1.80.0070.00017.60
8.1.70.0070.00017.55
8.1.60.0060.00317.67
8.1.50.0000.00817.80
8.1.40.0030.00517.74
8.1.30.0050.00317.83
8.1.20.0050.00317.79
8.1.10.0030.00517.83
8.1.00.0040.00417.73
8.0.300.0020.00518.77
8.0.290.0040.00417.18
8.0.280.0000.00718.49
8.0.270.0000.00717.39
8.0.260.0070.00017.12
8.0.250.0030.00317.23
8.0.240.0040.00417.23
8.0.230.0030.00317.24
8.0.220.0000.00717.17
8.0.210.0030.00317.16
8.0.200.0040.00417.25
8.0.190.0050.00317.26
8.0.180.0000.00817.22
8.0.170.0050.00317.18
8.0.160.0000.00817.15
8.0.150.0040.00417.09
8.0.140.0000.00717.07
8.0.130.0000.00713.52
8.0.120.0000.00817.07
8.0.110.0060.00317.14
8.0.100.0050.00217.20
8.0.90.0040.00416.99
8.0.80.0030.01417.18
8.0.70.0000.00717.18
8.0.60.0030.00516.98
8.0.50.0040.00417.15
8.0.30.0110.00817.31
8.0.20.0110.00917.40
8.0.10.0000.00817.08
8.0.00.0090.00917.01
7.4.330.0050.00015.06
7.4.320.0060.00016.64
7.4.300.0060.00016.87
7.4.290.0000.00716.88
7.4.280.0000.00816.75
7.4.270.0040.00416.69
7.4.260.0000.00716.83
7.4.250.0070.00016.84
7.4.240.0050.00316.79
7.4.230.0000.00716.97
7.4.220.0090.00916.81
7.4.210.0060.01216.80
7.4.200.0070.00016.86
7.4.190.0030.00316.80
7.4.160.0060.01016.95
7.4.150.0110.00717.40
7.4.140.0160.02017.86
7.4.130.0100.00716.81
7.4.120.0090.00916.73
7.4.110.0060.01216.68
7.4.100.0150.00316.95
7.4.90.0090.01516.62
7.4.80.0100.00719.39
7.4.70.0140.00916.59
7.4.60.0100.00716.80
7.4.50.0030.00616.82
7.4.40.0100.00722.77
7.4.30.0120.00616.82
7.4.00.0040.01215.39
7.3.330.0000.00513.59
7.3.320.0000.00613.55
7.3.310.0000.00716.63
7.3.300.0070.00016.61
7.3.290.0090.00616.55
7.3.280.0070.01216.56
7.3.270.0080.00817.40
7.3.260.0000.01916.49
7.3.250.0100.00716.85
7.3.240.0080.00816.91
7.3.230.0130.01016.83
7.3.210.0090.00916.52
7.3.200.0030.01419.39
7.3.190.0060.01616.88
7.3.180.0140.00316.94
7.3.170.0070.01016.80
7.3.160.0110.00616.61
7.3.120.0060.00915.27
7.3.10.0040.00816.64
7.3.00.0050.00516.88
7.2.330.0090.00916.71
7.2.320.0040.01316.89
7.2.310.0040.01416.84
7.2.300.0100.00616.79
7.2.290.0130.00316.77
7.2.130.0100.00317.10
7.2.120.0050.00517.20
7.2.110.0060.00617.30
7.2.100.0000.01017.15
7.2.90.0000.01317.16
7.2.80.0000.01217.08
7.2.70.0000.01217.38
7.2.60.0040.00817.27
7.2.50.0080.00617.13
7.2.40.0060.00617.23
7.2.30.0000.01116.91
7.2.20.0060.00917.19
7.2.10.0000.01117.09
7.2.00.0080.00817.23
7.1.250.0030.00915.88
7.1.200.0100.00715.89
7.1.70.0030.00717.09
7.1.60.0030.01619.82
7.1.50.0080.01117.31
7.1.00.0000.09722.45
7.0.200.0190.00316.62
7.0.140.0030.07322.00
7.0.60.0230.07321.73
7.0.50.0070.03717.93
7.0.40.0100.07720.42
7.0.30.0230.08020.28
7.0.20.0270.05720.40
7.0.10.0030.06020.24
7.0.00.0100.04320.27
5.6.280.0000.07721.06
5.6.210.0100.07720.78
5.6.200.0000.04718.20
5.6.190.0130.06720.77
5.6.180.0000.04320.39
5.6.170.0330.08020.51
5.6.160.0200.04320.55
5.6.150.0070.03718.22
5.6.140.0030.04018.32
5.6.130.0030.08318.21
5.6.120.0070.06020.92
5.6.110.0170.06020.90
5.6.100.0100.08021.04
5.6.90.0130.07321.05
5.6.80.0030.04020.37
5.5.350.0270.08020.36
5.5.340.0070.05317.96
5.5.330.0070.05020.19
5.5.320.0200.04320.36
5.5.310.0200.04320.23
5.5.300.0070.07017.98
5.5.290.0270.06018.04
5.5.280.0170.04720.90
5.5.270.0030.04320.75
5.5.260.0100.08320.86
5.5.250.0100.03320.72
5.5.240.0200.03020.30
5.4.450.4170.03719.52
5.4.440.0100.06719.55
5.4.430.1030.07019.54
5.4.420.4270.03719.38
5.4.410.4330.04019.37
5.4.400.4730.03319.15
5.4.390.4130.03018.93
5.4.380.4200.03019.19
5.4.370.4700.04019.26
5.4.360.5330.03318.94
5.4.350.4030.04318.95
5.4.340.4300.05018.93
5.4.320.3430.03018.98
5.4.310.3900.03719.23
5.4.300.3830.04319.22
5.4.290.4070.04019.14
5.4.280.4870.04019.22
5.4.270.4500.03719.04
5.4.260.4630.04019.19
5.4.250.4670.03319.12
5.4.240.4730.03319.21
5.4.230.4670.04319.05
5.4.220.2670.03319.18
5.4.210.2730.03719.23
5.4.200.3700.03719.06
5.4.190.3130.03318.96
5.4.180.2830.03319.12
5.4.170.2830.04318.91
5.4.160.2930.03319.05
5.4.150.3570.03318.96
5.4.140.3800.03716.40
5.4.130.3700.03716.54
5.4.120.4030.03716.43
5.4.110.4170.03316.32
5.4.100.4130.03316.49
5.4.90.3800.04016.27
5.4.80.3900.02316.51
5.4.70.4030.03716.53
5.4.60.4070.03716.21
5.4.50.3800.03016.57
5.4.40.3970.03316.51
5.4.30.4130.03316.45
5.4.20.3700.04016.45
5.4.10.3700.04016.41
5.4.00.3930.03315.72
5.3.290.3800.03714.70
5.3.280.3270.02714.57
5.3.270.1900.03314.70
5.3.260.2430.03714.65
5.3.250.4070.04014.66
5.3.240.4000.03714.65
5.3.230.3970.04314.62
5.3.220.4970.03314.50
5.3.210.3900.04014.62
5.3.200.4430.04014.62
5.3.190.3970.03014.64
5.3.180.3970.03314.73
5.3.170.3900.03314.59
5.3.160.4170.03314.62
5.3.150.3830.03714.63
5.3.140.3400.03014.65
5.3.130.3930.04314.48
5.3.120.4100.03714.59
5.3.110.3670.04014.59
5.3.100.4500.03713.97
5.3.90.4370.04014.05
5.3.80.4470.04314.18
5.3.70.3900.04313.96
5.3.60.3900.03714.07
5.3.50.3900.03714.05
5.3.40.3900.03714.01
5.3.30.4000.04013.94
5.3.20.3770.03713.64
5.3.10.3830.03013.64
5.3.00.4100.03313.71
5.2.170.3230.03011.23
5.2.160.3170.02011.25
5.2.150.3270.03311.33
5.2.140.3470.03011.25
5.2.130.3230.02711.14
5.2.120.3370.02711.17
5.2.110.3670.03311.16
5.2.100.3730.03011.13
5.2.90.3670.03011.18
5.2.80.3300.02711.16
5.2.70.2830.03011.04
5.2.60.3430.03311.14
5.2.50.3370.03011.10
5.2.40.3030.03010.91
5.2.30.3070.02011.04
5.2.20.3230.03010.91
5.2.10.2930.02710.88
5.2.00.2500.02710.75
5.1.60.2570.02310.02
5.1.50.3230.02710.01
5.1.40.3230.02710.16
5.1.30.3030.02710.37
5.1.20.3400.02710.34
5.1.10.3070.02710.00
5.1.00.3330.02710.00
5.0.50.1370.0178.65
5.0.40.1800.0238.59
5.0.30.1730.0308.24
5.0.20.1300.0208.25
5.0.10.1070.0178.11
5.0.00.1300.0378.35
4.4.90.1400.0175.87
4.4.80.1330.0135.84
4.4.70.1470.0205.83
4.4.60.1570.0135.89
4.4.50.1570.0175.80
4.4.40.1770.0275.85
4.4.30.1630.0175.90
4.4.20.1830.0135.84
4.4.10.1770.0135.91
4.4.00.1800.0275.88
4.3.110.1930.0135.79
4.3.100.1000.0135.84
4.3.90.1230.0175.80
4.3.80.1370.0235.71
4.3.70.1300.0175.77
4.3.60.1230.0175.73
4.3.50.1430.0175.73
4.3.40.1470.0205.70
4.3.30.0970.0235.31
4.3.20.0900.0235.31
4.3.10.0930.0205.31
4.3.00.0970.0235.31

preferences:
45.78 ms | 401 KiB | 5 Q