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 'AdsListExtractor.getURLs return' . $url_fiche; echo "\n"; return array( $url_fiche,$url_fiche ); } } class AdInfoExtractor { //private $html = 0; //function __construct($a1) //{ //$this->html = $a1; //} function getHMTL($html) { 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-bmw-x5-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 => $linee) { echo "\n"; $htmlfiche = $reader->getHTML($linee); 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.0120.00618.68
8.3.50.0050.01422.05
8.3.40.0100.00618.89
8.3.30.0110.00419.18
8.3.20.0080.00020.09
8.3.10.0040.00421.96
8.3.00.0000.00820.58
8.2.180.0130.00617.13
8.2.170.0110.00722.96
8.2.160.0090.00619.08
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0080.00026.16
8.2.120.0050.00319.73
8.2.110.0180.00422.25
8.2.100.0080.00318.03
8.2.90.0040.00419.17
8.2.80.0040.00418.03
8.2.70.0000.00817.75
8.2.60.0030.00617.93
8.2.50.0040.00418.07
8.2.40.0060.00318.16
8.2.30.0030.00618.15
8.2.20.0000.00817.82
8.2.10.0080.00018.04
8.2.00.0040.00417.87
8.1.280.0070.00725.92
8.1.270.0000.00822.14
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00623.62
8.1.230.0110.00019.09
8.1.220.0000.00817.78
8.1.210.0080.00018.77
8.1.200.0030.00617.60
8.1.190.0030.00517.66
8.1.180.0040.00418.89
8.1.170.0060.00318.89
8.1.160.0040.00422.24
8.1.150.0030.00618.87
8.1.140.0040.00417.63
8.1.130.0030.00317.87
8.1.120.0040.00417.55
8.1.110.0030.00617.62
8.1.100.0050.00317.55
8.1.90.0050.00517.55
8.1.80.0050.00217.65
8.1.70.0050.00317.62
8.1.60.0030.00617.75
8.1.50.0080.00017.59
8.1.40.0030.00617.60
8.1.30.0040.00417.77
8.1.20.0040.00417.74
8.1.10.0000.00817.73
8.1.00.0090.00017.63
8.0.300.0000.00918.77
8.0.290.0040.00417.30
8.0.280.0050.00318.38
8.0.270.0000.00717.23
8.0.260.0030.00317.07
8.0.250.0000.00717.22
8.0.240.0070.00017.21
8.0.230.0000.00717.21
8.0.220.0000.00817.11
8.0.210.0030.00317.16
8.0.200.0030.00317.17
8.0.190.0080.00017.07
8.0.180.0040.00417.08
8.0.170.0030.00617.16
8.0.160.0030.00517.22
8.0.150.0020.00517.05
8.0.140.0040.00417.00
8.0.130.0030.00313.61
8.0.120.0040.00417.18
8.0.110.0050.00316.96
8.0.100.0050.00316.94
8.0.90.0080.00016.98
8.0.80.0120.00317.04
8.0.70.0000.00817.14
8.0.60.0000.00816.96
8.0.50.0000.00817.02
8.0.30.0110.01017.31
8.0.20.0040.01517.40
8.0.10.0050.00217.21
8.0.00.0140.00917.05
7.4.330.0050.00015.18
7.4.320.0030.00316.68
7.4.300.0060.00016.78
7.4.290.0040.00416.73
7.4.280.0060.00316.79
7.4.270.0070.00016.75
7.4.260.0070.00016.83
7.4.250.0000.00816.80
7.4.240.0070.00216.89
7.4.230.0030.00416.59
7.4.220.0090.00916.86
7.4.210.0080.00716.81
7.4.200.0040.00416.67
7.4.190.0050.00216.73
7.4.160.0080.00816.97
7.4.150.0140.00617.40
7.4.140.0120.00717.86
7.4.130.0090.01116.94
7.4.120.0150.00416.68
7.4.110.0090.00916.74
7.4.100.0130.00616.71
7.4.90.0120.00616.64
7.4.80.0100.01019.39
7.4.70.0070.01116.89
7.4.60.0230.00316.81
7.4.50.0050.00516.83
7.4.40.0000.01522.77
7.4.30.0090.00916.79
7.4.10.0100.01015.29
7.4.00.0090.00915.38
7.3.330.0000.00513.56
7.3.320.0000.00613.63
7.3.310.0000.00716.58
7.3.300.0000.00716.53
7.3.290.0120.00316.57
7.3.280.0070.00916.49
7.3.270.0150.00317.40
7.3.260.0140.01016.59
7.3.250.0110.00916.77
7.3.240.0120.00916.82
7.3.230.0070.01116.73
7.3.210.0090.00916.70
7.3.200.0120.01216.74
7.3.190.0110.01116.53
7.3.180.0100.00716.80
7.3.170.0100.00716.74
7.3.160.0110.01016.72
7.3.130.0070.01415.09
7.3.120.0060.01015.13
7.3.110.0120.00614.96
7.3.100.0030.01014.84
7.3.90.0030.01015.03
7.3.80.0000.01014.91
7.3.70.0120.00315.22
7.3.60.0070.00714.99
7.3.50.0040.01215.21
7.3.40.0040.00715.09
7.3.30.0040.01215.02
7.3.20.0100.00016.98
7.3.10.0100.00716.74
7.3.00.0090.00616.66
7.2.330.0100.01316.86
7.2.320.0100.00717.02
7.2.310.0160.00317.02
7.2.300.0100.00816.73
7.2.290.0090.00816.85
7.2.260.0030.01615.40
7.2.250.0000.01615.35
7.2.240.0070.01015.50
7.2.230.0080.00815.53
7.2.220.0070.00415.29
7.2.210.0070.00715.42
7.2.200.0030.01015.43
7.2.190.0060.00614.98
7.2.180.0060.01015.09
7.2.170.0100.00315.34
7.2.160.0090.00615.29
7.2.150.0080.00617.14
7.2.140.0080.00617.21
7.2.130.0030.01617.02
7.2.120.0030.01017.25
7.2.110.0000.01016.95
7.2.100.0090.00617.14
7.2.90.0100.00716.98
7.2.80.0000.01616.93
7.2.70.0030.00917.23
7.2.60.0030.00717.21
7.2.50.0090.00617.16
7.2.40.0000.01317.26
7.2.30.0000.01317.01
7.2.20.0030.00716.96
7.2.10.0040.00817.18
7.2.00.0030.01317.11
7.1.330.0060.00915.98
7.1.320.0080.00415.98
7.1.310.0090.00615.94
7.1.300.0000.01415.83
7.1.290.0140.00315.94
7.1.280.0070.00715.89
7.1.270.0100.00616.17
7.1.260.0000.01416.09
7.1.250.0040.00716.21
7.1.240.0090.00615.80
7.1.230.0040.00815.88
7.1.220.0060.00616.00
7.1.210.0060.00915.87
7.1.200.0070.01115.91
7.1.190.0070.00415.86
7.1.180.0000.01515.93
7.1.170.0030.01016.19
7.1.160.0060.00315.84
7.1.150.0070.00716.07
7.1.140.0040.00416.14
7.1.130.0060.00916.09
7.1.120.0060.01316.13
7.1.110.0030.01615.86
7.1.100.0040.00415.99
7.1.90.0070.00716.15
7.1.80.0030.00615.81
7.1.70.0060.00816.54
7.1.60.0000.01416.79
7.1.50.0060.01316.68
7.1.40.0060.00316.07
7.1.30.0090.00615.71
7.1.20.0050.00515.99
7.1.10.0040.00815.74
7.1.00.0050.03819.21
7.0.330.0090.00915.29
7.0.320.0000.00915.52
7.0.310.0030.01015.50
7.0.300.0100.00615.63
7.0.290.0060.01015.78
7.0.280.0000.01415.39
7.0.270.0040.01215.69
7.0.260.0090.00915.40
7.0.250.0030.01015.81
7.0.240.0080.00615.77
7.0.230.0040.01115.74
7.0.220.0120.00315.78
7.0.210.0070.00315.66
7.0.200.0060.00616.29
7.0.190.0060.00915.82
7.0.180.0070.00315.75
7.0.170.0090.00615.48
7.0.160.0000.01315.77
7.0.150.0030.01015.59
7.0.140.0070.04118.86
7.0.130.0060.00615.44
7.0.120.0030.00615.74
7.0.110.0030.01215.41
7.0.100.0070.01015.63
7.0.90.0040.00415.75
7.0.80.0060.00315.75
7.0.70.0000.01415.75
7.0.60.0080.02317.85
7.0.50.0080.03316.74
7.0.40.0100.04716.96
7.0.30.0210.04016.93
7.0.20.0190.04716.91
7.0.10.0110.02316.85
7.0.00.0050.02516.85
5.6.400.0060.00614.54
5.6.390.0070.00714.52
5.6.380.0040.00814.30
5.6.370.0070.01014.45
5.6.360.0060.00314.70
5.6.350.0070.01114.47
5.6.340.0090.00014.79
5.6.330.0100.00614.84
5.6.320.0000.01214.35
5.6.310.0040.01114.33
5.6.300.0110.00314.71
5.6.290.0070.00314.73
5.6.280.0110.03517.67
5.6.270.0040.00714.66
5.6.260.0000.01414.56
5.6.250.0100.00614.44
5.6.240.0050.00514.38
5.6.230.0040.00814.38
5.6.220.0100.00314.52
5.6.210.0120.03817.48
5.6.200.0020.05216.41
5.6.190.0100.04317.45
5.6.180.1870.02117.46
5.6.170.0280.03617.55
5.6.160.0100.03617.54
5.6.150.0050.03416.39
5.6.140.0060.02316.39
5.6.130.0040.03116.31
5.6.120.0090.04017.69
5.6.110.0050.04617.66
5.6.100.0100.03817.73
5.6.90.0030.04817.79
5.6.80.0050.03717.39
5.6.70.2040.02217.29
5.6.60.0000.01014.20
5.6.50.0000.01014.45
5.6.40.0040.01514.48
5.6.30.0040.01414.34
5.6.20.0000.01314.45
5.6.10.0040.01114.47
5.6.00.0060.01214.35
5.5.380.0040.00714.45
5.5.370.0040.01114.48
5.5.360.0090.00914.15
5.5.350.0080.04017.36
5.5.340.0070.04216.10
5.5.330.0040.03217.35
5.5.320.0160.03717.44
5.5.310.0150.02217.39
5.5.300.0020.04716.24
5.5.290.0070.03016.31
5.5.280.0070.04917.67
5.5.270.0060.02317.64
5.5.260.0030.02517.79
5.5.250.0060.04317.59
5.5.240.0040.02617.35
5.5.230.0070.00314.37
5.5.220.0070.00714.10
5.5.210.0060.00914.44
5.5.200.0070.01014.20
5.5.190.0030.01414.13
5.5.180.0070.00714.46
5.5.170.0030.01014.22
5.5.160.0040.01514.44
5.5.150.0040.01114.06
5.5.140.0060.00614.56
5.5.130.0070.01014.49
5.5.120.0000.01914.34
5.5.110.0130.00314.51
5.5.100.0000.01214.50
5.5.90.0070.00714.50
5.5.80.0000.01514.63
5.5.70.0040.01114.41
5.5.60.0000.01014.49
5.5.50.0130.00014.32
5.5.40.0000.01214.46
5.5.30.0000.01514.34
5.5.20.0090.00614.57
5.5.10.0030.00614.44
5.5.00.0040.00814.05
5.4.450.0270.03016.07
5.4.440.0250.03215.82
5.4.430.0270.02816.10
5.4.420.0150.03315.90
5.4.410.0200.03615.97
5.4.400.0400.00715.61
5.4.390.0400.00315.50
5.4.380.0110.03315.51
5.4.370.0130.03715.55
5.4.360.0190.02715.63
5.4.350.0180.02815.63
5.4.340.0160.02615.56
5.4.330.0040.00412.50
5.4.320.0050.02312.51
5.4.310.0050.02812.51
5.4.300.0090.02212.51
5.4.290.0060.02412.51
5.4.280.0090.02012.46
5.4.270.0090.02012.46
5.4.260.0020.03415.78
5.4.250.0090.03915.71
5.4.240.0090.02915.65
5.4.230.0020.04515.69
5.4.220.0080.03915.69
5.4.210.0060.04115.78
5.4.200.0080.02815.72
5.4.190.0070.03015.75
5.4.180.0080.03015.57
5.4.170.0030.03315.69
5.4.160.0110.02615.78
5.4.150.0050.03015.71
5.4.140.0090.02514.43
5.4.130.0040.03114.52
5.4.120.0070.02814.50
5.4.110.0050.03014.41
5.4.100.0080.02514.54
5.4.90.0080.03714.48
5.4.80.0060.02614.42
5.4.70.0030.02814.51
5.4.60.0120.02314.43
5.4.50.0050.02814.39
5.4.40.0060.03014.54
5.4.30.0060.03314.39
5.4.20.0080.02714.47
5.4.10.0050.03114.39
5.4.00.0030.02814.17
5.3.290.0070.02612.65
5.3.280.0000.04213.54
5.3.270.0060.04313.63
5.3.260.0070.03013.60
5.3.250.0100.02313.68
5.3.240.0060.02813.56
5.3.230.0070.03013.68
5.3.220.0070.03013.59
5.3.210.0050.02813.58
5.3.200.0060.02913.58
5.3.190.0050.02613.46
5.3.180.0080.02413.59
5.3.170.0070.02713.58
5.3.160.0070.02613.61
5.3.150.0050.03613.61
5.3.140.0140.02313.52
5.3.130.0050.03213.62
5.3.120.0080.02813.49
5.3.110.0100.02513.52
5.3.100.0100.02513.36
5.3.90.0080.02313.28
5.3.80.0110.02413.26
5.3.70.0110.02313.19
5.3.60.0030.02913.30
5.3.50.0050.02713.27
5.3.40.0080.02613.24
5.3.30.0090.02313.21
5.3.20.0020.03113.15
5.3.10.0030.02613.08
5.3.00.0090.03913.16
5.2.170.0100.03711.14
5.2.160.0100.03711.16
5.2.150.0130.03711.07
5.2.140.0070.04011.23
5.2.130.0100.03311.08
5.2.120.0000.04311.20
5.2.110.0070.04311.10
5.2.100.0100.05011.08
5.2.90.0070.03711.28
5.2.80.0000.04711.33
5.2.70.0070.03711.29
5.2.60.0070.04010.98
5.2.50.0100.03710.88
5.2.40.0100.04711.03
5.2.30.0030.04011.02
5.2.20.0130.03011.05
5.2.10.0130.03310.79
5.2.00.0000.04310.70
5.1.60.0000.0409.86
5.1.50.0030.03710.02
5.1.40.0030.0409.98
5.1.30.0030.03710.54
5.1.20.0170.02310.29
5.1.10.0000.0439.93
5.1.00.0030.03710.01
5.0.50.0070.0378.55
5.0.40.0000.0338.64
5.0.30.0070.0578.36
5.0.20.0070.0378.32
5.0.10.0030.0308.21
5.0.00.0070.0408.39
4.4.90.0000.0236.41
4.4.80.0000.0276.41
4.4.70.0000.0236.41
4.4.60.0030.0206.41
4.4.50.0000.0276.41
4.4.40.0070.0436.41
4.4.30.0100.0236.41
4.4.20.0070.0176.41
4.4.10.0030.0306.41
4.4.00.0030.0336.41
4.3.110.0000.0336.41
4.3.100.0000.0336.41
4.3.90.0000.0276.41
4.3.80.0030.0336.41
4.3.70.0030.0206.41
4.3.60.0030.0206.41
4.3.50.0070.0176.41
4.3.40.0030.0336.41
4.3.30.0000.0236.41
4.3.20.0000.0276.41
4.3.10.0000.0236.41
4.3.00.0030.0206.84

preferences:
53.94 ms | 401 KiB | 5 Q