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"; } } echo $mail_html;

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.0090.00618.68
8.3.50.0140.00622.05
8.3.40.0120.00318.93
8.3.30.0110.00419.21
8.3.20.0030.00520.39
8.3.10.0050.00322.00
8.3.00.0080.00022.52
8.2.180.0080.00816.88
8.2.170.0120.00322.96
8.2.160.0070.00719.34
8.2.150.0030.00524.18
8.2.140.0000.00824.66
8.2.130.0040.01126.16
8.2.120.0060.00319.61
8.2.110.0090.00022.20
8.2.100.0040.00718.03
8.2.90.0040.00419.35
8.2.80.0060.00318.05
8.2.70.0000.00917.74
8.2.60.0080.00017.93
8.2.50.0080.00018.07
8.2.40.0030.00518.34
8.2.30.0040.00418.07
8.2.20.0040.00417.99
8.2.10.0000.00817.96
8.2.00.0000.00817.82
8.1.280.0070.01425.92
8.1.270.0080.00022.23
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00023.97
8.1.230.0060.00619.22
8.1.220.0040.00417.77
8.1.210.0000.00818.77
8.1.200.0040.00417.48
8.1.190.0080.00017.55
8.1.180.0000.00918.86
8.1.170.0040.00418.71
8.1.160.0040.00422.21
8.1.150.0030.00518.79
8.1.140.0000.00817.58
8.1.130.0030.00317.81
8.1.120.0030.00317.65
8.1.110.0030.00617.70
8.1.100.0040.00417.69
8.1.90.0030.00417.68
8.1.80.0070.00017.66
8.1.70.0030.00317.62
8.1.60.0000.00917.68
8.1.50.0000.00817.75
8.1.40.0050.00317.70
8.1.30.0040.00417.71
8.1.20.0080.00017.83
8.1.10.0040.00417.70
8.1.00.0000.00817.63
8.0.300.0040.00418.77
8.0.290.0000.00717.41
8.0.280.0070.00018.50
8.0.270.0040.00417.38
8.0.260.0030.00317.05
8.0.250.0000.00717.04
8.0.240.0050.00317.16
8.0.230.0000.00717.05
8.0.220.0000.00617.01
8.0.210.0030.00317.05
8.0.200.0000.00717.18
8.0.190.0030.00617.17
8.0.180.0050.00217.10
8.0.170.0050.00317.04
8.0.160.0000.00817.00
8.0.150.0030.00617.11
8.0.140.0050.00316.93
8.0.130.0000.00613.46
8.0.120.0050.00517.07
8.0.110.0040.00417.05
8.0.100.0000.00716.95
8.0.90.0000.00817.02
8.0.80.0120.00317.07
8.0.70.0000.00717.14
8.0.60.0040.00417.15
8.0.50.0030.00617.07
8.0.30.0100.00917.53
8.0.20.0110.01017.49
8.0.10.0040.00417.00
8.0.00.0140.00817.03
7.4.330.0000.00515.11
7.4.320.0040.00416.87
7.4.300.0030.00316.91
7.4.290.0040.00416.75
7.4.280.0070.00016.76
7.4.270.0040.00416.81
7.4.260.0000.00716.84
7.4.250.0040.00416.87
7.4.240.0020.00516.88
7.4.230.0030.00316.93
7.4.220.0070.01116.80
7.4.210.0060.00816.82
7.4.200.0000.00716.82
7.4.190.0000.00716.89
7.4.160.0080.00816.61
7.4.150.0120.00617.40
7.4.140.0110.00717.86
7.4.130.0120.00916.70
7.4.120.0090.00816.81
7.4.110.0070.01016.71
7.4.100.0110.00716.83
7.4.90.0090.00916.90
7.4.80.0070.01819.39
7.4.70.0160.00416.72
7.4.60.0070.01316.75
7.4.50.0020.00216.66
7.4.40.0110.00322.77
7.4.30.0090.00916.65
7.4.00.0140.00315.42
7.3.330.0050.00013.37
7.3.320.0000.00513.34
7.3.310.0030.00316.61
7.3.300.0030.00316.41
7.3.290.0100.00916.45
7.3.280.0060.01116.50
7.3.270.0070.01117.40
7.3.260.0090.01016.73
7.3.250.0110.00916.53
7.3.240.0110.01516.69
7.3.230.0090.00916.60
7.3.210.0080.01116.52
7.3.200.0070.01419.39
7.3.190.0090.00916.62
7.3.180.0080.00816.75
7.3.170.0060.01216.71
7.3.160.0100.00716.70
7.3.120.0030.01514.92
7.3.110.0070.01415.03
7.3.100.0120.00615.13
7.3.90.0040.01115.05
7.3.80.0000.01914.97
7.3.70.0040.01115.05
7.3.60.0100.00715.13
7.3.50.0040.00715.13
7.3.40.0060.00814.88
7.3.30.0040.00815.18
7.3.20.0070.01016.70
7.3.10.0060.00916.82
7.3.00.0070.00716.61
7.2.330.0200.00316.77
7.2.320.0110.00816.74
7.2.310.0130.01017.06
7.2.300.0090.00916.85
7.2.290.0120.00816.94
7.2.250.0180.00315.50
7.2.240.0090.01215.32
7.2.230.0060.01315.11
7.2.220.0110.00815.33
7.2.210.0070.01015.28
7.2.200.0000.01515.20
7.2.190.0030.01015.23
7.2.180.0070.01015.47
7.2.170.0060.00915.18
7.2.00.0060.00619.86
7.1.330.0040.01116.12
7.1.320.0000.01216.00
7.1.310.0100.00615.86
7.1.300.0060.00615.96
7.1.290.0070.01116.22
7.1.280.0000.00915.96
7.1.270.0070.00715.95
7.1.260.0030.01216.11
7.1.70.0000.01117.13
7.1.60.0070.01117.27
7.1.50.0100.00317.14
7.1.00.0030.09322.46
7.0.200.0060.00916.65
7.0.140.0070.07022.08
7.0.60.0030.09019.91
7.0.50.0070.08017.93
7.0.40.0000.04720.27
7.0.30.0300.08020.21
7.0.20.0270.07720.23
7.0.10.0300.06720.13
7.0.00.0030.08720.11
5.6.280.0000.07721.15
5.6.210.0130.07320.70
5.6.200.0130.07318.28
5.6.190.0030.09020.53
5.6.180.4030.04720.63
5.6.170.0470.07020.54
5.6.160.0200.07020.49
5.6.150.0170.08018.27
5.6.140.0200.04718.27
5.6.130.0030.06718.21
5.6.120.0130.07320.99
5.6.110.0030.04721.03
5.6.100.0070.08720.99
5.6.90.0030.08020.94
5.6.80.0030.08720.41
5.6.70.4270.03720.29
5.5.350.0030.08020.40
5.5.340.0100.07317.96
5.5.330.0200.07020.31
5.5.320.0170.04020.27
5.5.310.0200.04720.51
5.5.300.0030.04718.05
5.5.290.0030.04017.98
5.5.280.0030.06320.90
5.5.270.0070.08720.78
5.5.260.0030.08720.79
5.5.250.0100.08020.80
5.5.240.0200.07020.21
5.4.450.0300.06019.64
5.4.440.0130.05719.59
5.4.430.0600.05019.16
5.4.420.0370.06019.44
5.4.410.0400.05719.26
5.4.400.1030.00018.82
5.4.390.0800.00018.84
5.4.380.0270.05718.54
5.4.370.0300.05018.52
5.4.360.0330.04018.55
5.4.350.0270.05718.61
5.4.340.0270.04318.58
5.4.320.0080.03312.52
5.4.310.0070.03712.51
5.4.300.0110.03212.52
5.4.290.0060.03712.52
5.4.280.0050.03612.41
5.4.270.0040.03812.41
5.4.260.0070.06019.00
5.4.250.0100.05019.09
5.4.240.0070.05318.75
5.4.230.0100.05718.98
5.4.220.0100.05019.09
5.4.210.0130.06018.90
5.4.200.0030.06318.76
5.4.190.0100.05318.89
5.4.180.0030.05318.98
5.4.170.0030.05318.89
5.4.160.0070.06018.95
5.4.150.0030.05718.96
5.4.140.0070.05016.45
5.4.130.0200.04316.60
5.4.120.0030.05316.44
5.4.110.0030.05716.52
5.4.100.0130.04316.56
5.4.90.0030.05016.60
5.4.80.0100.04716.45
5.4.70.0030.07016.35
5.4.60.0070.05016.54
5.4.50.0130.06716.34
5.4.40.0070.05716.54
5.4.30.0100.06016.50
5.4.20.0070.04716.45
5.4.10.0100.05016.37
5.4.00.0070.05015.89
5.3.290.0090.04012.80
5.3.280.0170.05714.68
5.3.270.0170.05314.59
5.3.260.0070.05014.70
5.3.250.0130.05714.66
5.3.240.0100.05014.71
5.3.230.0100.05314.70
5.3.220.0030.06014.57
5.3.210.0100.05014.75
5.3.200.0100.05014.80
5.3.190.0030.05714.75
5.3.180.0130.05014.57
5.3.170.0070.05014.57
5.3.160.0070.05014.72
5.3.150.0100.06314.66
5.3.140.0030.05714.75
5.3.130.0070.05314.48
5.3.120.0070.05314.57
5.3.110.0100.05014.57
5.3.100.0000.05714.05
5.3.90.0030.05014.12
5.3.80.0030.05314.20
5.3.70.0030.05314.13
5.3.60.0100.04313.98
5.3.50.0000.06014.05
5.3.40.0130.05713.97
5.3.30.0030.05013.93
5.3.20.0100.04313.68
5.3.10.0130.06313.64
5.3.00.0070.04713.49
5.2.170.0100.04011.15
5.2.160.0030.04011.25
5.2.150.0030.04011.15
5.2.140.0100.04711.34
5.2.130.0030.04011.28
5.2.120.0100.03311.20
5.2.110.0070.03711.09
5.2.100.0170.04711.21
5.2.90.0030.04311.11
5.2.80.0070.04011.27
5.2.70.0130.03311.33
5.2.60.0170.04711.16
5.2.50.0130.03710.88
5.2.40.0100.05011.21
5.2.30.0130.03311.00
5.2.20.0030.05010.97
5.2.10.0070.05310.86
5.2.00.0000.05710.92
5.1.60.0000.04010.17
5.1.50.0070.03010.08
5.1.40.0000.0379.96
5.1.30.0000.03710.58
5.1.20.0070.04310.46
5.1.10.0030.04710.05
5.1.00.0100.03010.04
5.0.50.0070.0378.59
5.0.40.0000.0308.39
5.0.30.0000.0438.36
5.0.20.0000.0308.27
5.0.10.0000.0338.20
5.0.00.0000.0508.17
4.4.90.0000.0236.51
4.4.80.0030.0206.51
4.4.70.0070.0206.51
4.4.60.0030.0276.51
4.4.50.0030.0306.51
4.4.40.0070.0276.51
4.4.30.0000.0306.51
4.4.20.0000.0306.51
4.4.10.0030.0206.51
4.4.00.0030.0336.47
4.3.110.0100.0176.47
4.3.100.0000.0306.47
4.3.90.0030.0206.47
4.3.80.0000.0406.47
4.3.70.0100.0176.39
4.3.60.0000.0306.25
4.3.50.0000.0236.10
4.3.40.0030.0306.10
4.3.30.0070.0206.10
4.3.20.0030.0306.09
4.3.10.0030.0206.05
4.3.00.0070.0177.29

preferences:
33.21 ms | 401 KiB | 5 Q