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($hmtl) { echo '------'.$html; $regexatt = '/\<table class="ad-attributes">(.*)\<\/table\>/'; preg_match($regexatt, $html, $matches); $a = $matches[1]; $regexcontent = '/\<div id="UserContent">(.*)\<\/div\>/'; preg_match($regexcontent, $html, $matches); $b = $matches[1]; return $a . $b; } } class HTMLReader { function getHTML($url) { echo "\n"; echo 'url::'.$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"') { echo "\n"; echo 'true'; echo "\n"; return "liste <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 { echo "\n"; echo 'false'; echo "\n"; return 'fiche <table class="ad-attributes">yesser</table> dfdssd <div id="UserContent">good</div> dfdfdf df df'; } echo "\n"; } } $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)); echo "\n"; foreach ($liste->getURLs() as $line_number => $line2) { echo "\n"; $htmlfiche = $reader->getHTML($line2); echo "\n"; $ad_info = new AdInfoExtractor(); $mail_html = $mail_html . $ad_info->getHMTL($htmlfiche); 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.0160.00018.51
8.3.50.0100.00522.05
8.3.40.0000.01919.09
8.3.30.0150.00019.22
8.3.20.0050.00320.35
8.3.10.0040.00421.96
8.3.00.0000.00822.28
8.2.180.0160.00616.75
8.2.170.0070.00722.96
8.2.160.0070.00719.21
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0060.01226.16
8.2.120.0000.00819.50
8.2.110.0060.00320.52
8.2.100.0120.00018.03
8.2.90.0030.00617.86
8.2.80.0000.00819.15
8.2.70.0080.00017.88
8.2.60.0030.00617.88
8.2.50.0040.00417.73
8.2.40.0030.00718.34
8.2.30.0000.00818.25
8.2.20.0040.00418.02
8.2.10.0040.00417.82
8.2.00.0000.00817.97
8.1.280.0110.00725.92
8.1.270.0060.00322.10
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0100.00018.86
8.1.230.0090.00320.97
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0080.00017.60
8.1.190.0000.00817.47
8.1.180.0060.00318.10
8.1.170.0040.00418.62
8.1.160.0040.00422.24
8.1.150.0040.00418.82
8.1.140.0040.00417.63
8.1.130.0000.00717.80
8.1.120.0030.00517.64
8.1.110.0080.00017.52
8.1.100.0040.00417.63
8.1.90.0040.00417.65
8.1.80.0000.00717.53
8.1.70.0000.00817.59
8.1.60.0040.00417.82
8.1.50.0050.00317.77
8.1.40.0050.00317.73
8.1.30.0030.00617.78
8.1.20.0040.00417.85
8.1.10.0000.00817.66
8.1.00.0030.00617.63
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0080.00018.50
8.0.270.0040.00417.23
8.0.260.0070.00017.11
8.0.250.0000.00717.23
8.0.240.0030.00517.07
8.0.230.0050.00317.13
8.0.220.0030.00317.14
8.0.210.0040.00417.14
8.0.200.0030.00317.08
8.0.190.0050.00317.09
8.0.180.0040.00417.16
8.0.170.0080.00017.14
8.0.160.0030.00617.17
8.0.150.0000.00817.13
8.0.140.0030.00516.93
8.0.130.0060.00013.54
8.0.120.0040.00417.01
8.0.110.0080.00016.96
8.0.100.0040.00417.03
8.0.90.0050.00317.05
8.0.80.0110.00517.02
8.0.70.0040.00417.14
8.0.60.0000.00817.21
8.0.50.0050.00317.00
8.0.30.0060.01417.26
8.0.20.0130.00517.52
8.0.10.0000.00817.30
8.0.00.0110.00817.12
7.4.330.0030.00215.13
7.4.320.0030.00316.80
7.4.300.0070.00016.77
7.4.290.0070.00016.75
7.4.280.0030.00316.85
7.4.270.0030.00316.68
7.4.260.0000.00816.81
7.4.250.0000.00816.82
7.4.240.0070.00116.70
7.4.230.0040.00416.73
7.4.220.0090.00916.78
7.4.210.0060.01016.86
7.4.200.0000.00816.66
7.4.190.0000.00716.80
7.4.160.0100.01316.64
7.4.150.0120.00717.40
7.4.140.0150.00617.86
7.4.130.0080.01116.82
7.4.120.0070.01116.74
7.4.110.0120.00616.75
7.4.100.0050.01416.91
7.4.90.0090.00916.95
7.4.80.0040.01419.39
7.4.70.0160.00316.61
7.4.60.0120.00416.77
7.4.50.0080.00016.67
7.4.40.0070.00722.77
7.4.30.0070.01116.94
7.4.10.0090.00915.18
7.4.00.0070.01115.25
7.3.330.0050.00013.55
7.3.320.0000.00513.63
7.3.310.0000.00716.47
7.3.300.0050.00516.56
7.3.290.0040.01316.53
7.3.280.0100.00816.50
7.3.270.0120.00617.40
7.3.260.0130.01316.86
7.3.250.0060.01316.65
7.3.240.0170.00016.55
7.3.230.0090.00916.91
7.3.210.0100.01516.82
7.3.200.0110.01416.66
7.3.190.0110.00716.69
7.3.180.0130.01016.75
7.3.170.0080.01116.87
7.3.160.0170.00016.77
7.3.130.0100.00715.18
7.3.120.0130.00215.11
7.3.110.0080.00915.07
7.3.100.0080.00715.13
7.3.90.0020.01515.11
7.3.80.0080.00514.87
7.3.70.0060.00714.94
7.3.60.0020.01215.16
7.3.50.0040.00915.02
7.3.40.0040.00714.89
7.3.30.0070.00615.05
7.3.20.0020.01217.01
7.3.10.0040.00916.94
7.3.00.0030.00817.01
7.2.330.0110.00716.88
7.2.320.0060.01217.03
7.2.310.0090.00916.95
7.2.300.0040.01517.05
7.2.290.0130.00717.04
7.2.260.0090.00615.23
7.2.250.0070.01215.51
7.2.240.0130.00515.21
7.2.230.0090.00815.36
7.2.220.0110.00715.49
7.2.210.0050.00715.30
7.2.200.0050.00915.48
7.2.190.0050.01215.38
7.2.180.0020.01415.36
7.2.170.0070.00615.44
7.2.160.0090.00015.29
7.2.150.0070.00717.18
7.2.140.0070.00717.25
7.2.130.0100.00316.97
7.2.120.0030.01217.14
7.2.110.0000.01117.22
7.2.100.0070.00417.19
7.2.90.0000.01316.89
7.2.80.0040.00717.02
7.2.70.0040.01517.32
7.2.60.0060.01017.06
7.2.50.0030.00917.26
7.2.40.0070.01117.22
7.2.30.0030.01417.24
7.2.20.0070.01017.16
7.2.10.0080.00817.30
7.2.00.0050.01118.47
7.1.330.0030.01215.76
7.1.320.0070.00716.06
7.1.310.0060.00916.27
7.1.300.0060.00815.93
7.1.290.0050.00916.00
7.1.280.0070.00716.10
7.1.270.0090.00515.84
7.1.260.0070.00715.97
7.1.250.0080.00816.11
7.1.240.0070.00716.02
7.1.230.0060.00615.97
7.1.220.0070.01015.91
7.1.210.0110.00416.19
7.1.200.0060.00816.00
7.1.190.0070.01115.85
7.1.180.0030.00915.92
7.1.170.0090.00315.95
7.1.160.0090.00615.84
7.1.150.0040.01115.86
7.1.140.0040.01215.95
7.1.130.0000.01316.19
7.1.120.0070.01015.86
7.1.110.0110.00016.04
7.1.100.0070.00617.28
7.1.90.0090.00316.01
7.1.80.0090.00315.93
7.1.70.0080.00516.78
7.1.60.0020.01617.74
7.1.50.0090.00516.52
7.1.40.0030.00615.86
7.1.30.0000.01516.14
7.1.20.0030.01216.13
7.1.10.0080.00516.09
7.1.00.0060.04219.17
7.0.330.0000.00915.48
7.0.320.0070.00715.67
7.0.310.0090.00615.84
7.0.300.0040.00415.55
7.0.290.0000.01915.56
7.0.280.0040.01115.40
7.0.270.0090.00615.50
7.0.260.0030.01415.41
7.0.250.0030.01215.69
7.0.240.0030.00915.49
7.0.230.0060.00915.52
7.0.220.0080.00415.36
7.0.210.0030.00615.32
7.0.200.0040.00816.18
7.0.190.0070.00715.70
7.0.180.0080.00015.81
7.0.170.0000.01415.82
7.0.160.0030.00915.62
7.0.150.0000.01015.65
7.0.140.0070.04018.90
7.0.130.0110.00415.50
7.0.120.0100.00315.69
7.0.110.0040.00815.57
7.0.100.0070.03017.78
7.0.90.0030.02617.77
7.0.80.0060.02417.90
7.0.70.0030.02817.85
7.0.60.0080.02517.87
7.0.50.0080.02917.91
7.0.40.0040.03916.77
7.0.30.0000.02916.87
7.0.20.0050.03416.77
7.0.10.0030.02716.91
7.0.00.0070.04616.84
5.6.400.0070.00714.48
5.6.390.0000.01214.50
5.6.380.0110.00414.71
5.6.370.0070.01014.48
5.6.360.0100.00314.73
5.6.350.0040.01514.30
5.6.340.0050.00514.69
5.6.330.0000.01614.32
5.6.320.0030.00814.81
5.6.310.0080.00314.60
5.6.300.0040.00414.54
5.6.290.0070.00714.76
5.6.280.0060.03817.91
5.6.270.0110.00314.27
5.6.260.0080.00814.37
5.6.250.0050.03917.68
5.6.240.0050.03617.71
5.6.230.0060.02317.44
5.6.220.0050.03317.59
5.6.210.0060.03517.71
5.6.200.0050.03017.86
5.6.190.0090.01817.84
5.6.180.0050.02317.70
5.6.170.0050.02317.82
5.6.160.0070.04717.88
5.6.150.0120.03717.79
5.6.140.0120.04017.64
5.6.130.0090.04217.62
5.6.120.0100.04317.68
5.6.110.0100.04517.67
5.6.100.0090.03417.80
5.6.90.0030.04817.81
5.6.80.0050.03717.56
5.6.70.0070.04517.41
5.6.60.0050.03517.57
5.6.50.0100.04117.46
5.6.40.0130.03917.34
5.6.30.0050.04717.34
5.6.20.0050.03317.43
5.6.10.0050.04517.52
5.6.00.0060.03817.35
5.5.380.0100.03517.40
5.5.370.0110.02017.65
5.5.360.0090.02017.51
5.5.350.0020.02717.46
5.5.340.0110.01817.59
5.5.330.0050.02317.60
5.5.320.0030.03017.73
5.5.310.0050.03617.71
5.5.300.0100.03917.59
5.5.290.0020.04817.72
5.5.280.0070.04017.68
5.5.270.0070.04517.67
5.5.260.0040.04917.54
5.5.250.0080.04017.44
5.5.240.0100.03617.27
5.5.230.0050.04517.23
5.5.220.0080.04317.19
5.5.210.0070.04317.46
5.5.200.0070.02817.34
5.5.190.0070.04117.25
5.5.180.0070.03917.34
5.5.170.0120.00314.52
5.5.160.0100.04217.36
5.5.150.0070.04017.27
5.5.140.0050.04417.19
5.5.130.0030.04317.39
5.5.120.0080.02117.33
5.5.110.0120.03417.23
5.5.100.0070.04217.20
5.5.90.0050.04617.30
5.5.80.0140.03617.36
5.5.70.0050.04517.29
5.5.60.0070.02517.11
5.5.50.0040.04417.30
5.5.40.0120.03317.17
5.5.30.0080.04117.21
5.5.20.0150.03517.04
5.5.10.0000.04917.11
5.5.00.0090.04017.20
5.4.450.0030.04315.44
5.4.440.0080.04015.29
5.4.430.0100.02515.54
5.4.420.0120.03915.36
5.4.410.0070.03715.22
5.4.400.0060.04115.06
5.4.390.0100.04414.90
5.4.380.0060.04215.19
5.4.370.0090.03815.12
5.4.360.0070.04015.05
5.4.350.0070.02515.13
5.4.340.0020.04315.32
5.4.330.0070.00011.23
5.4.320.0080.03715.16
5.4.310.0060.02815.20
5.4.300.0050.04015.18
5.4.290.0070.03815.25
5.4.280.0140.03514.95
5.4.270.0100.03814.92
5.4.260.0050.03815.31
5.4.250.0050.04115.09
5.4.240.0070.03815.16
5.4.230.0050.04315.12
5.4.220.0020.02615.21
5.4.210.0050.03515.00
5.4.200.0110.03615.11
5.4.190.0120.03015.15
5.4.180.0060.02315.07
5.4.170.0030.03215.14
5.4.160.0130.03115.09
5.4.150.0050.04315.16
5.4.140.0060.04313.84
5.4.130.0030.03713.82
5.4.120.0030.04013.73
5.4.110.0070.03913.79
5.4.100.0060.03613.80
5.4.90.0060.03813.70
5.4.80.0070.02913.69
5.4.70.0030.04213.73
5.4.60.0080.02513.86
5.4.50.0020.04013.74
5.4.40.0030.04313.77
5.4.30.0040.03413.78
5.4.20.0080.02813.87
5.4.10.0030.03713.67
5.4.00.0080.03613.30
5.3.290.0030.04612.69
5.3.280.0060.01812.69
5.3.270.0070.03712.69
5.3.260.0040.04012.81
5.3.250.0090.03812.67
5.3.240.0060.03912.49
5.3.230.0030.03812.56
5.3.220.0050.03312.69
5.3.210.0050.04312.61
5.3.200.0080.03912.52
5.3.190.0080.02012.65
5.3.180.0050.04112.70
5.3.170.0070.03212.67
5.3.160.0050.02312.69
5.3.150.0030.04112.62
5.3.140.0050.03812.77
5.3.130.0050.02312.62
5.3.120.0100.03412.64
5.3.110.0050.04212.74
5.3.100.0030.03512.43
5.3.90.0030.04712.46
5.3.80.0120.03512.40
5.3.70.0070.03812.35
5.3.60.0040.04012.36
5.3.50.0050.02312.39
5.3.40.0090.03712.22
5.3.30.0020.02912.33
5.3.20.0030.04012.19
5.3.10.0100.03012.03
5.3.00.0050.03511.90
5.2.170.0070.06311.29
5.2.160.0030.05711.10
5.2.150.0030.03711.22
5.2.140.0000.06311.23
5.2.130.0030.04310.98
5.2.120.0000.06311.15
5.2.110.0030.03311.25
5.2.100.0030.06011.26
5.2.90.0070.05711.06
5.2.80.0030.05311.26
5.2.70.0000.05011.15
5.2.60.0100.06011.01
5.2.50.0030.06011.18
5.2.40.0000.05310.91
5.2.30.0070.06311.05
5.2.20.0000.06011.11
5.2.10.0030.06010.91
5.2.00.0100.05310.71
5.1.60.0030.05010.31
5.1.50.0000.05310.31
5.1.40.0030.03710.31
5.1.30.0030.03310.37
5.1.20.0030.03310.45
5.1.10.0100.05310.31
5.1.00.0000.03710.31
5.0.50.0130.03710.31
5.0.40.0000.04310.31
5.0.30.0030.06310.31
5.0.20.0100.03710.31
5.0.10.0030.04010.31
5.0.00.0000.06010.31
4.4.90.0000.03710.31
4.4.80.0030.03010.31
4.4.70.0030.03310.31
4.4.60.0030.03710.31
4.4.50.0000.02010.31
4.4.40.0030.05310.31
4.4.30.0000.03310.31
4.4.20.0030.03710.31
4.4.10.0000.04010.31
4.4.00.0070.05010.31
4.3.110.0030.03310.31
4.3.100.0030.03310.31
4.3.90.0070.03010.31
4.3.80.0100.04710.31
4.3.70.0000.03310.31
4.3.60.0000.02010.31
4.3.50.0000.03310.31
4.3.40.0070.04310.31
4.3.30.0070.03010.31
4.3.20.0000.03710.31
4.3.10.0000.02010.31
4.3.00.0030.03310.31

preferences:
59.84 ms | 401 KiB | 5 Q