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.70.0160.00318.55
8.3.60.0130.00318.36
8.3.50.0100.01022.24
8.3.40.0130.00319.21
8.3.30.0070.00719.04
8.3.20.0040.00420.20
8.3.10.0050.00322.10
8.3.00.0030.00520.64
8.2.180.0030.01216.63
8.2.170.0150.00022.96
8.2.160.0150.00019.20
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00419.68
8.2.110.0070.00322.26
8.2.100.0090.00319.91
8.2.90.0040.00419.21
8.2.80.0060.00317.97
8.2.70.0060.00317.88
8.2.60.0050.00318.16
8.2.50.0000.00918.07
8.2.40.0090.00018.22
8.2.30.0040.00418.24
8.2.20.0060.00317.87
8.2.10.0000.00817.98
8.2.00.0000.00817.86
8.1.280.0090.00925.92
8.1.270.0000.00821.91
8.1.260.0000.00926.35
8.1.250.0050.00328.09
8.1.240.0070.00323.89
8.1.230.0060.00619.10
8.1.220.0090.00017.79
8.1.210.0060.00318.77
8.1.200.0040.00717.48
8.1.190.0000.00817.55
8.1.180.0040.00418.78
8.1.170.0080.00018.74
8.1.160.0040.00422.19
8.1.150.0000.00818.82
8.1.140.0000.00917.64
8.1.130.0030.00317.85
8.1.120.0000.00717.69
8.1.110.0050.00517.52
8.1.100.0000.00817.70
8.1.90.0000.00817.65
8.1.80.0040.00417.67
8.1.70.0000.00817.59
8.1.60.0060.00317.60
8.1.50.0000.00817.59
8.1.40.0000.00817.57
8.1.30.0050.00317.71
8.1.20.0040.00417.80
8.1.10.0000.00817.62
8.1.00.0040.00417.71
8.0.300.0040.00418.77
8.0.290.0040.00417.30
8.0.280.0030.00318.42
8.0.270.0040.00417.36
8.0.260.0000.00716.98
8.0.250.0030.00417.18
8.0.240.0070.00017.20
8.0.230.0030.00517.08
8.0.220.0050.00317.09
8.0.210.0000.00717.11
8.0.200.0000.00717.21
8.0.190.0000.00817.16
8.0.180.0000.00817.07
8.0.170.0000.00817.12
8.0.160.0050.00317.13
8.0.150.0000.00716.95
8.0.140.0070.00017.07
8.0.130.0060.00013.52
8.0.120.0040.00417.09
8.0.110.0050.00317.18
8.0.100.0000.00817.08
8.0.90.0040.00417.20
8.0.80.0040.01217.18
8.0.70.0040.00417.18
8.0.60.0030.00516.93
8.0.50.0030.00517.08
8.0.30.0120.00717.49
8.0.20.0130.00817.48
8.0.10.0040.00417.11
8.0.00.0080.01316.84
7.4.330.0000.00515.16
7.4.320.0000.00716.87
7.4.300.0030.00316.71
7.4.290.0000.00716.75
7.4.280.0000.00716.83
7.4.270.0040.00416.85
7.4.260.0000.01016.72
7.4.250.0000.00716.73
7.4.240.0040.00416.84
7.4.230.0040.00416.60
7.4.220.0160.00316.95
7.4.210.0090.00916.88
7.4.200.0070.00016.88
7.4.190.0000.00816.98
7.4.160.0100.00516.95
7.4.150.0140.00617.40
7.4.140.0120.00717.86
7.4.130.0090.00916.78
7.4.120.0100.00716.68
7.4.110.0070.01116.65
7.4.100.0110.00716.89
7.4.90.0130.00716.72
7.4.80.0130.01019.39
7.4.70.0170.00516.64
7.4.60.0100.00716.82
7.4.50.0060.00316.73
7.4.40.0070.00722.77
7.4.30.0040.01416.74
7.4.00.0100.00715.27
7.3.330.0030.00313.51
7.3.320.0000.00513.41
7.3.310.0000.00716.70
7.3.300.0030.00316.68
7.3.290.0120.00416.51
7.3.280.0100.00616.56
7.3.270.0080.01617.40
7.3.260.0110.00716.54
7.3.250.0120.00816.61
7.3.240.0100.00716.68
7.3.230.0080.01116.57
7.3.210.0120.00616.76
7.3.200.0140.00719.39
7.3.190.0100.00716.85
7.3.180.0090.00916.73
7.3.170.0150.00316.84
7.3.160.0080.01216.73
7.3.120.0070.01015.07
7.3.110.0030.01415.04
7.3.100.0120.00615.14
7.3.90.0090.00615.13
7.3.80.0000.01415.08
7.3.70.0030.00715.11
7.3.60.0090.00614.99
7.3.50.0080.00014.95
7.3.40.0040.01114.70
7.3.30.0040.01115.17
7.3.20.0000.01117.00
7.3.10.0060.00616.72
7.3.00.0000.01317.03
7.2.330.0170.01316.87
7.2.320.0090.00917.05
7.2.310.0130.00616.91
7.2.300.0110.00716.88
7.2.290.0150.00916.78
7.2.250.0090.00915.38
7.2.240.0130.00915.32
7.2.230.0130.00315.52
7.2.220.0000.01815.17
7.2.210.0040.01115.34
7.2.200.0080.00815.24
7.2.190.0040.01115.43
7.2.180.0000.00915.35
7.2.170.0040.01115.30
7.2.160.0040.00815.29
7.2.150.0060.00617.27
7.2.140.0030.01116.98
7.2.130.0030.00717.24
7.2.120.0060.00617.11
7.2.110.0070.00716.93
7.2.100.0070.00717.09
7.2.90.0000.01217.23
7.2.80.0140.00317.20
7.2.70.0090.00617.00
7.2.60.0050.01017.23
7.2.50.0030.01317.25
7.2.40.0040.01117.31
7.2.30.0030.01017.33
7.2.20.0080.00417.08
7.2.10.0030.01017.18
7.2.00.0100.00316.96
7.1.330.0100.01016.28
7.1.320.0110.00716.09
7.1.310.0090.00615.92
7.1.300.0080.00415.98
7.1.290.0000.00815.85
7.1.280.0100.00315.72
7.1.270.0100.00316.09
7.1.260.0030.01016.13
7.1.250.0100.00316.04
7.1.240.0030.01316.08
7.1.230.0000.00916.01
7.1.220.0030.00915.73
7.1.210.0040.00415.77
7.1.200.0070.00816.05
7.1.190.0060.00315.87
7.1.180.0070.00715.93
7.1.170.0030.01416.23
7.1.160.0040.01115.86
7.1.150.0000.01015.76
7.1.140.0070.00316.21
7.1.130.0000.01316.10
7.1.120.0000.01416.19
7.1.110.0090.00616.17
7.1.100.0040.00815.89
7.1.90.0070.00316.21
7.1.80.0060.00615.88
7.1.70.0050.00516.84
7.1.60.0080.01017.99
7.1.50.0050.00516.30
7.1.40.0100.00715.85
7.1.30.0060.01016.03
7.1.20.0040.00816.00
7.1.10.0030.00716.03
7.1.00.0000.04719.38
7.0.330.0000.01415.81
7.0.320.0030.01015.63
7.0.310.0060.00915.35
7.0.300.0070.00415.65
7.0.290.0000.01115.42
7.0.280.0060.00915.61
7.0.270.0030.01015.57
7.0.260.0090.00615.76
7.0.250.0040.00715.70
7.0.240.0040.00415.54
7.0.230.0040.00815.47
7.0.220.0100.00315.85
7.0.210.0040.01115.85
7.0.200.0040.01016.17
7.0.190.0040.01115.54
7.0.180.0140.00015.76
7.0.170.0110.00015.79
7.0.160.0070.00715.56
7.0.150.0040.00715.75
7.0.140.0060.03918.80
7.0.130.0000.01515.50
7.0.120.0050.00615.67
7.0.110.0100.00315.79
7.0.100.0070.00315.45
7.0.90.0030.01015.66
7.0.80.0060.00615.60
7.0.70.0090.00615.78
7.0.60.0120.03817.70
7.0.50.0070.02716.65
7.0.40.0080.04616.94
7.0.30.0150.04516.89
7.0.20.0150.03116.89
7.0.10.0070.02216.93
7.0.00.0070.02217.02
5.6.400.0030.01314.76
5.6.390.0070.00714.61
5.6.380.0080.00314.73
5.6.370.0080.00414.48
5.6.360.0060.00814.81
5.6.350.0030.01314.64
5.6.340.0040.01114.83
5.6.330.0110.00414.70
5.6.320.0060.00614.44
5.6.310.0080.00314.39
5.6.300.0060.00614.70
5.6.290.0070.00314.62
5.6.280.0030.04217.80
5.6.270.0040.01214.46
5.6.260.0100.00714.66
5.6.250.0090.00614.72
5.6.240.0100.00314.49
5.6.230.0100.00314.38
5.6.220.0030.00714.28
5.6.210.0100.04117.52
5.6.200.0080.04216.45
5.6.190.0050.04017.73
5.6.180.0090.04517.46
5.6.170.0150.02517.55
5.6.160.0070.04717.37
5.6.150.0060.04516.40
5.6.140.0120.04216.35
5.6.130.0070.04516.57
5.6.120.0080.03517.85
5.6.110.0070.04017.80
5.6.100.0180.03017.71
5.6.90.0050.04617.74
5.6.80.0070.04317.61
5.6.70.0080.00414.30
5.6.60.0100.00314.30
5.6.50.0110.00414.33
5.6.40.0070.00714.32
5.6.30.0070.00714.52
5.6.20.0000.00814.58
5.6.10.0060.00314.30
5.6.00.0040.00814.48
5.5.380.0030.01314.21
5.5.370.0060.00614.60
5.5.360.0000.01414.83
5.5.350.0050.04317.38
5.5.340.0050.02816.13
5.5.330.0060.02517.36
5.5.320.0090.04217.30
5.5.310.0200.04217.27
5.5.300.0030.02916.12
5.5.290.0030.02816.27
5.5.280.0100.04217.77
5.5.270.0050.03017.82
5.5.260.0080.04017.73
5.5.250.0070.03917.46
5.5.240.0050.04217.35
5.5.230.0060.00914.47
5.5.220.0000.01514.47
5.5.210.0040.00814.56
5.5.200.0060.00914.54
5.5.190.0000.00814.35
5.5.180.0040.00814.43
5.5.170.0100.00714.48
5.5.160.0070.00714.16
5.5.150.0090.00614.36
5.5.140.0090.00314.52
5.5.130.0040.00714.51
5.5.120.0120.00314.63
5.5.110.0100.00314.48
5.5.100.0040.00714.17
5.5.90.0000.01114.31
5.5.80.0120.00414.60
5.5.70.0040.00714.34
5.5.60.0060.00914.53
5.5.50.0100.00314.09
5.5.40.0040.00814.06
5.5.30.0030.01314.43
5.5.20.0040.01114.62
5.5.10.0040.00414.16
5.5.00.0040.01114.54
5.4.450.0380.02715.23
5.4.440.0170.02515.34
5.4.430.0210.02115.38
5.4.420.0250.02015.34
5.4.410.0160.01815.25
5.4.400.0450.02015.21
5.4.390.0350.02115.14
5.4.380.0170.03314.95
5.4.370.0210.02815.15
5.4.360.0250.03114.92
5.4.350.0350.03314.87
5.4.340.0250.02714.94
5.4.330.0030.00910.96
5.4.320.0030.02411.79
5.4.310.0060.02211.88
5.4.300.0040.02311.94
5.4.290.0060.02411.96
5.4.280.0080.01911.87
5.4.270.0040.02411.68
5.4.260.0020.03214.97
5.4.250.0080.03114.97
5.4.240.0080.03815.01
5.4.230.0100.03515.02
5.4.220.0080.04015.05
5.4.210.0090.03414.92
5.4.200.0030.04315.12
5.4.190.0110.03015.11
5.4.180.0110.03314.97
5.4.170.0090.02915.08
5.4.160.0080.03515.06
5.4.150.0070.04015.00
5.4.140.0070.03013.90
5.4.130.0080.02613.86
5.4.120.0100.02913.73
5.4.110.0050.03613.91
5.4.100.0120.02714.01
5.4.90.0050.02813.68
5.4.80.0050.02713.77
5.4.70.0080.02413.92
5.4.60.0020.03213.91
5.4.50.0100.02313.68
5.4.40.0030.02813.86
5.4.30.0090.02413.69
5.4.20.0070.02913.72
5.4.10.0020.03413.79
5.4.00.0070.03313.56
5.3.290.0040.02111.73
5.3.280.0110.03612.68
5.3.270.0050.02912.62
5.3.260.0100.03712.46
5.3.250.0030.03112.62
5.3.240.0020.03312.65
5.3.230.0050.03012.71
5.3.220.0050.02912.55
5.3.210.0110.02612.65
5.3.200.0070.02812.58
5.3.190.0070.03012.64
5.3.180.0080.02812.58
5.3.170.0050.02912.75
5.3.160.0070.04012.76
5.3.150.0070.02812.67
5.3.140.0070.02712.64
5.3.130.0020.04712.55
5.3.120.0050.03112.64
5.3.110.0110.02812.64
5.3.100.0100.02312.29
5.3.90.0050.03012.50
5.3.80.0080.02712.26
5.3.70.0040.04012.36
5.3.60.0050.04112.27
5.3.50.0100.03212.29
5.3.40.0100.02312.25
5.3.30.0050.03812.36
5.3.20.0110.03112.18
5.3.10.0100.03312.09
5.3.00.0100.03512.10
5.2.170.0030.06311.23
5.2.160.0070.06011.16
5.2.150.0130.04011.19
5.2.140.0070.06011.34
5.2.130.0170.04311.30
5.2.120.0100.05011.29
5.2.110.0070.04011.35
5.2.100.0170.05011.13
5.2.90.0130.03311.12
5.2.80.0070.04310.94
5.2.70.0100.03710.94
5.2.60.0130.03311.08
5.2.50.0070.04010.88
5.2.40.0130.03311.11
5.2.30.0030.04310.90
5.2.20.0000.04310.96
5.2.10.0030.04010.84
5.2.00.0070.03710.92
5.1.60.0030.05310.07
5.1.50.0070.05010.02
5.1.40.0000.0539.92
5.1.30.0000.05710.34
5.1.20.0000.04010.36
5.1.10.0030.03710.25
5.1.00.0000.03710.14
5.0.50.0070.0308.55
5.0.40.0070.0308.51
5.0.30.0000.0578.46
5.0.20.0130.0238.18
5.0.10.0000.0308.40
5.0.00.0030.0408.24
4.4.90.0000.0236.39
4.4.80.0000.0236.39
4.4.70.0000.0236.39
4.4.60.0000.0336.39
4.4.50.0000.0306.39
4.4.40.0000.0376.39
4.4.30.0030.0236.39
4.4.20.0000.0236.39
4.4.10.0070.0176.39
4.4.00.0070.0336.39
4.3.110.0030.0236.39
4.3.100.0030.0276.39
4.3.90.0030.0236.39
4.3.80.0030.0476.39
4.3.70.0000.0306.39
4.3.60.0070.0136.39
4.3.50.0100.0206.39
4.3.40.0070.0306.39
4.3.30.0000.0306.39
4.3.20.0030.0236.39
4.3.10.0000.0236.39
4.3.00.0070.01712.80

preferences:
61.8 ms | 401 KiB | 5 Q