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) { 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.00418.68
8.3.50.0110.00922.17
8.3.40.0090.00619.16
8.3.30.0060.00919.34
8.3.20.0000.00920.33
8.3.10.0080.00021.86
8.3.00.0080.00020.77
8.2.180.0040.01216.63
8.2.170.0090.00622.96
8.2.160.0120.00319.31
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.01526.16
8.2.120.0120.00319.73
8.2.110.0030.00722.18
8.2.100.0090.00318.09
8.2.90.0040.00418.16
8.2.80.0000.00817.97
8.2.70.0050.00517.88
8.2.60.0000.00918.04
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0040.00418.21
8.2.20.0040.00417.89
8.2.10.0050.00218.04
8.2.00.0040.00718.01
8.1.280.0070.01125.92
8.1.270.0040.00422.16
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00722.50
8.1.230.0060.00621.01
8.1.220.0030.00517.90
8.1.210.0000.00919.11
8.1.200.0040.00417.38
8.1.190.0000.00817.53
8.1.180.0000.00818.89
8.1.170.0030.00618.72
8.1.160.0070.00022.12
8.1.150.0040.00418.86
8.1.140.0080.00017.61
8.1.130.0050.00319.35
8.1.120.0040.00417.67
8.1.110.0060.00317.68
8.1.100.0050.00317.55
8.1.90.0030.00517.68
8.1.80.0040.00417.64
8.1.70.0000.00717.55
8.1.60.0060.00317.77
8.1.50.0000.00817.64
8.1.40.0040.00417.75
8.1.30.0060.00317.84
8.1.20.0040.00417.88
8.1.10.0000.00817.70
8.1.00.0090.00017.68
8.0.300.0070.00019.88
8.0.290.0040.00417.25
8.0.280.0070.00018.57
8.0.270.0040.00417.32
8.0.260.0070.00016.99
8.0.250.0000.00717.06
8.0.240.0050.00317.23
8.0.230.0040.00417.21
8.0.220.0030.00317.12
8.0.210.0040.00417.18
8.0.200.0030.00317.13
8.0.190.0000.00817.20
8.0.180.0040.00417.18
8.0.170.0080.00017.13
8.0.160.0000.00717.02
8.0.150.0000.00717.00
8.0.140.0050.00217.11
8.0.130.0060.00013.59
8.0.120.0030.00517.16
8.0.110.0000.00817.20
8.0.100.0040.00417.17
8.0.90.0000.00817.13
8.0.80.0090.00917.15
8.0.70.0030.00516.96
8.0.60.0040.00416.97
8.0.50.0000.00817.22
8.0.30.0130.00717.30
8.0.20.0130.01017.46
8.0.10.0040.00417.09
8.0.00.0120.00917.13
7.4.330.0000.00615.10
7.4.320.0060.00016.79
7.4.300.0030.00316.88
7.4.290.0040.00416.72
7.4.280.0050.00316.84
7.4.270.0050.00216.82
7.4.260.0070.00316.89
7.4.250.0050.00316.72
7.4.240.0000.00816.81
7.4.230.0000.00716.95
7.4.220.0070.01116.72
7.4.210.0070.01016.90
7.4.200.0070.00016.67
7.4.190.0070.00016.83
7.4.160.0000.01516.98
7.4.150.0100.00717.40
7.4.140.0070.01217.86
7.4.130.0100.00816.67
7.4.120.0090.01016.85
7.4.110.0070.01116.73
7.4.100.0080.00816.67
7.4.90.0090.00916.90
7.4.80.0130.01519.39
7.4.70.0120.01216.73
7.4.60.0150.00316.95
7.4.50.0030.00616.80
7.4.40.0000.01722.77
7.4.30.0090.00916.83
7.4.00.0040.00815.07
7.3.330.0050.00013.52
7.3.320.0000.00513.54
7.3.310.0040.00316.62
7.3.300.0030.00316.47
7.3.290.0090.01316.59
7.3.280.0070.00916.54
7.3.270.0150.00917.40
7.3.260.0090.00916.75
7.3.250.0080.01016.71
7.3.240.0060.01116.64
7.3.230.0060.01616.57
7.3.210.0100.01016.55
7.3.200.0100.00719.39
7.3.190.0130.01016.80
7.3.180.0120.00616.52
7.3.170.0140.00416.76
7.3.160.0130.00616.82
7.3.120.0110.00514.82
7.3.110.0060.01215.00
7.3.100.0100.00315.10
7.3.90.0120.00315.35
7.3.80.0090.00315.16
7.3.70.0070.00714.97
7.3.60.0110.00715.07
7.3.50.0000.00915.11
7.3.40.0100.00614.83
7.3.30.0100.00314.99
7.3.20.0070.00316.98
7.3.10.0000.01516.79
7.3.00.0090.00316.90
7.2.330.0120.00917.10
7.2.320.0030.01516.93
7.2.310.0110.01416.96
7.2.300.0100.00716.85
7.2.290.0080.00816.88
7.2.250.0110.00815.39
7.2.240.0100.01015.30
7.2.230.0030.01015.14
7.2.220.0070.00715.53
7.2.210.0000.01915.23
7.2.200.0000.01015.50
7.2.190.0070.01115.44
7.2.180.0060.00915.11
7.2.170.0120.00315.35
7.2.60.0090.00617.21
7.1.330.0100.00615.80
7.1.320.0030.00616.23
7.1.310.0090.00616.00
7.1.300.0030.01016.15
7.1.290.0060.01016.14
7.1.280.0070.00715.97
7.1.270.0060.00316.23
7.1.260.0140.00016.26
7.1.200.0060.00615.99
7.1.70.0040.00417.39
7.1.60.0070.01019.82
7.1.50.0060.00617.28
7.1.00.0070.09022.34
7.0.200.0030.00617.04
7.0.140.0030.07321.93
7.0.60.0030.08319.96
7.0.50.0030.07717.99
7.0.40.0100.08320.27
7.0.30.0330.07320.11
7.0.20.0230.07320.32
7.0.10.0200.07020.22
7.0.00.0100.05320.11
5.6.280.0170.05721.04
5.6.210.0100.06320.62
5.6.200.0100.06018.19
5.6.190.0030.05720.52
5.6.180.3670.04020.58
5.6.170.0370.08020.50
5.6.160.0000.05020.52
5.6.150.0100.08018.22
5.6.140.0100.07318.24
5.6.130.0130.03018.16
5.6.120.0030.05720.92
5.6.110.0070.05721.06
5.6.100.0070.05321.13
5.6.90.0030.04720.99
5.6.80.0000.04320.41
5.6.70.4400.03720.39
5.5.350.0030.04320.30
5.5.340.0000.04317.94
5.5.330.0030.04320.44
5.5.320.0230.05020.38
5.5.310.0270.07020.51
5.5.300.0100.07718.08
5.5.290.0100.04318.09
5.5.280.0030.07320.92
5.5.270.0070.04720.75
5.5.260.0030.04020.89
5.5.250.0000.08320.60
5.5.240.0000.07020.28
5.4.450.0030.07319.48
5.4.440.0700.04319.40
5.4.430.1730.03319.54
5.4.420.1930.04319.63
5.4.410.1970.04719.26
5.4.400.1800.04018.97
5.4.390.2000.04019.31
5.4.380.1970.04019.14
5.4.370.1700.03719.06
5.4.360.1800.03019.31
5.4.350.1830.03719.22
5.4.340.1800.03319.16
5.4.320.0400.04319.15
5.4.310.0000.04019.22
5.4.300.0300.02718.94
5.4.290.1830.03719.18
5.4.280.1830.03319.16
5.4.270.2000.03719.21
5.4.260.1630.03719.13
5.4.250.1830.03719.08
5.4.240.1800.03018.99
5.4.230.1730.03719.07
5.4.220.1800.03719.30
5.4.210.1800.04019.30
5.4.200.2070.04018.93
5.4.190.1770.03719.20
5.4.180.0230.04019.20
5.4.170.0030.04019.30
5.4.160.0430.04719.16
5.4.150.1970.04719.04
5.4.140.1770.04016.56
5.4.130.1870.03716.36
5.4.120.1800.04016.41
5.4.110.1800.03316.60
5.4.100.2170.04316.56
5.4.90.1930.04316.61
5.4.80.1770.04016.54
5.4.70.1730.04316.58
5.4.60.1700.03716.24
5.4.50.0700.03716.48
5.4.40.0070.07016.54
5.4.30.0000.04316.42
5.4.20.1670.03316.50
5.4.10.1830.04716.51
5.4.00.1530.03015.95
5.3.290.1730.03314.60
5.3.280.1930.04314.85
5.3.270.1730.04314.88
5.3.260.1700.03714.53
5.3.250.1900.03314.63
5.3.240.1930.04714.77
5.3.230.2130.04314.64
5.3.220.2030.04714.73
5.3.210.0100.06714.49
5.3.200.0000.04714.69
5.3.190.0930.05314.67
5.3.180.2000.04314.81
5.3.170.1930.05014.51
5.3.160.1830.03714.49
5.3.150.2070.03714.55
5.3.140.1930.03714.73
5.3.130.2030.05014.62
5.3.120.1830.04014.55
5.3.110.1870.04714.49
5.3.100.2000.04013.97
5.3.90.1130.03714.03
5.3.80.0030.04313.94
5.3.70.0100.07714.19
5.3.60.1430.04713.93
5.3.50.2030.04014.06
5.3.40.2030.04313.98
5.3.30.2000.04713.99
5.3.20.1800.03313.73
5.3.10.1930.03713.68
5.3.00.1770.04013.59
5.2.170.1670.04311.08
5.2.160.1530.03011.13
5.2.150.1700.03311.40
5.2.140.1570.04011.26
5.2.130.0470.03311.06
5.2.120.0030.06311.04
5.2.110.0030.03311.09
5.2.100.0700.03011.21
5.2.90.1700.03011.25
5.2.80.1600.03011.13
5.2.70.1430.02711.07
5.2.60.1630.02711.03
5.2.50.1430.02711.05
5.2.40.1170.02711.14
5.2.30.1400.04010.90
5.2.20.1330.03310.96
5.2.10.1270.02711.03
5.2.00.1270.04310.97
5.1.60.1570.03010.12
5.1.50.1400.02710.26
5.1.40.1200.03010.25
5.1.30.0000.03010.59
5.1.20.0030.03010.50
5.1.10.0000.02710.19
5.1.00.0200.02310.18
5.0.50.0600.0238.46
5.0.40.0670.0138.43
5.0.30.0600.0308.31
5.0.20.0730.0238.17
5.0.10.0730.0238.22
5.0.00.0600.0308.12
4.4.90.0670.0138.00
4.4.80.0600.0138.01
4.4.70.0600.0138.01
4.4.60.0600.0138.05
4.4.50.0800.0178.05
4.4.40.0570.0278.06
4.4.30.0600.0138.07
4.4.20.0570.0178.07
4.4.10.0570.0178.07
4.4.00.0570.0278.07
4.3.110.0430.0178.08
4.3.100.0600.0208.08
4.3.90.0630.0138.12
4.3.80.0500.0238.13
4.3.70.0570.0178.13
4.3.60.0630.0138.13
4.3.50.0600.0138.13
4.3.40.0470.0238.13
4.3.30.0330.0178.13
4.3.20.0000.0178.14
4.3.10.0000.0138.15
4.3.00.0000.0138.16

preferences:
45.8 ms | 401 KiB | 5 Q