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 $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-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_num => $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.70.0090.00916.88
8.3.60.0130.00718.80
8.3.50.0070.01222.05
8.3.40.0090.00619.12
8.3.30.0110.00718.98
8.3.20.0030.00520.29
8.3.10.0000.00821.80
8.3.00.0040.00422.57
8.2.190.0090.00618.27
8.2.180.0160.00316.88
8.2.170.0120.00322.96
8.2.160.0060.01019.16
8.2.150.0050.00524.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0060.00319.61
8.2.110.0060.00322.31
8.2.100.0040.00819.82
8.2.90.0030.00619.36
8.2.80.0080.00017.97
8.2.70.0090.00017.75
8.2.60.0060.00317.93
8.2.50.0080.00018.07
8.2.40.0030.00618.28
8.2.30.0040.00418.20
8.2.20.0030.00617.78
8.2.10.0040.00417.93
8.2.00.0050.00317.99
8.1.280.0110.00325.92
8.1.270.0050.00322.32
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0090.00023.96
8.1.230.0060.00618.97
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.01017.72
8.1.190.0060.00317.65
8.1.180.0060.00318.86
8.1.170.0040.00418.70
8.1.160.0000.00722.11
8.1.150.0040.00418.67
8.1.140.0040.00417.51
8.1.130.0070.00017.75
8.1.120.0040.00417.61
8.1.110.0000.00917.67
8.1.100.0040.00417.69
8.1.90.0040.00417.66
8.1.80.0000.00717.61
8.1.70.0000.00717.52
8.1.60.0060.00317.81
8.1.50.0100.00017.72
8.1.40.0050.00317.71
8.1.30.0040.00417.67
8.1.20.0000.00817.83
8.1.10.0030.00617.75
8.1.00.0090.00017.66
8.0.300.0040.00418.77
8.0.290.0040.00417.18
8.0.280.0040.00418.50
8.0.270.0030.00317.31
8.0.260.0000.00717.02
8.0.250.0030.00317.11
8.0.240.0040.00417.20
8.0.230.0000.00717.08
8.0.220.0030.00317.20
8.0.210.0070.00017.17
8.0.200.0030.00317.09
8.0.190.0000.00717.06
8.0.180.0040.00417.05
8.0.170.0030.00517.13
8.0.160.0050.00317.12
8.0.150.0000.00717.07
8.0.140.0040.00417.16
8.0.130.0000.00613.63
8.0.120.0030.00516.98
8.0.110.0000.00817.17
8.0.100.0000.00817.13
8.0.90.0080.00017.23
8.0.80.0130.00317.14
8.0.70.0040.00417.13
8.0.60.0080.00017.20
8.0.50.0070.00016.96
8.0.30.0140.00817.34
8.0.20.0080.01217.47
8.0.10.0000.00717.29
8.0.00.0060.01217.16
7.4.330.0060.00015.07
7.4.320.0070.00016.83
7.4.300.0030.00316.73
7.4.290.0070.00016.87
7.4.280.0000.00716.66
7.4.270.0000.00716.65
7.4.260.0050.00516.82
7.4.250.0040.00416.73
7.4.240.0020.00616.77
7.4.230.0070.00016.84
7.4.220.0090.00916.79
7.4.210.0060.00916.78
7.4.200.0050.00216.67
7.4.190.0000.00716.57
7.4.160.0100.00716.66
7.4.150.0060.01217.40
7.4.140.0110.00917.86
7.4.130.0140.00716.68
7.4.120.0140.00616.73
7.4.110.0130.00716.67
7.4.100.0120.00616.84
7.4.90.0070.01716.65
7.4.80.0070.01019.39
7.4.70.0040.01516.66
7.4.60.0110.00617.00
7.4.50.0030.00616.87
7.4.40.0110.00022.77
7.4.30.0060.01616.55
7.4.10.0060.01215.23
7.4.00.0100.00715.06
7.3.330.0050.00013.53
7.3.320.0030.00313.59
7.3.310.0000.00716.50
7.3.300.0030.00316.55
7.3.290.0000.01516.53
7.3.280.0080.01116.52
7.3.270.0080.01217.40
7.3.260.0100.01016.81
7.3.250.0110.00616.78
7.3.240.0100.00716.51
7.3.230.0060.01416.75
7.3.210.0080.00816.59
7.3.200.0070.01119.39
7.3.190.0060.01216.55
7.3.180.0080.00816.79
7.3.170.0160.00016.68
7.3.160.0100.00716.85
7.3.130.0030.01615.00
7.3.120.0070.00715.16
7.3.110.0130.00615.13
7.3.100.0060.00915.15
7.3.90.0160.00315.02
7.3.80.0180.00315.26
7.3.70.0110.00315.14
7.3.60.0030.00915.18
7.3.50.0090.00614.66
7.3.40.0000.01214.87
7.3.30.0030.01015.10
7.3.20.0000.01316.95
7.3.10.0060.00916.53
7.3.00.0120.00316.96
7.2.330.0100.00716.68
7.2.320.0100.01016.96
7.2.310.0040.01517.04
7.2.300.0180.00016.97
7.2.290.0100.00716.88
7.2.260.0150.00015.34
7.2.250.0040.01515.39
7.2.240.0070.00715.29
7.2.230.0130.00315.45
7.2.220.0090.01215.35
7.2.210.0090.00015.35
7.2.200.0130.00015.31
7.2.190.0040.01215.12
7.2.180.0060.00915.27
7.2.170.0040.00815.27
7.2.160.0130.00315.39
7.2.150.0000.01317.03
7.2.140.0040.01117.20
7.2.130.0040.00817.36
7.2.120.0080.00316.82
7.2.110.0070.00717.05
7.2.100.0000.01317.05
7.2.90.0030.01016.94
7.2.80.0000.00917.16
7.2.70.0070.00317.14
7.2.60.0060.01317.30
7.2.50.0040.01417.18
7.2.40.0070.00417.12
7.2.30.0090.00317.21
7.2.20.0140.00017.22
7.2.10.0040.00717.27
7.2.00.0070.00717.21
7.1.330.0120.00315.85
7.1.320.0020.01615.98
7.1.310.0070.00416.13
7.1.300.0070.00315.75
7.1.290.0040.00816.15
7.1.280.0000.01416.02
7.1.270.0040.00416.07
7.1.260.0070.01015.98
7.1.250.0030.01016.06
7.1.240.0030.00915.91
7.1.230.0030.01016.13
7.1.220.0110.00615.71
7.1.210.0040.00815.87
7.1.200.0110.00315.80
7.1.190.0040.01415.92
7.1.180.0150.00316.09
7.1.170.0090.00616.00
7.1.160.0060.00615.91
7.1.150.0070.01015.80
7.1.140.0060.00616.16
7.1.130.0000.00816.05
7.1.120.0050.00515.81
7.1.110.0070.01016.00
7.1.100.0030.01016.21
7.1.90.0060.00615.82
7.1.80.0050.00515.93
7.1.70.0090.00516.78
7.1.60.0070.01018.00
7.1.50.0060.00616.48
7.1.40.0060.01015.64
7.1.30.0070.01015.91
7.1.20.0060.00916.21
7.1.10.0110.00616.09
7.1.00.0080.03819.31
7.0.330.0030.00915.42
7.0.320.0100.00715.66
7.0.310.0040.00415.50
7.0.300.0100.00315.48
7.0.290.0120.00015.69
7.0.280.0000.01415.27
7.0.270.0030.00915.56
7.0.260.0040.00715.63
7.0.250.0070.00715.77
7.0.240.0030.01015.74
7.0.230.0040.00415.77
7.0.220.0090.00615.50
7.0.210.0030.01015.49
7.0.200.0050.00616.32
7.0.190.0030.01015.23
7.0.180.0030.01015.68
7.0.170.0070.00615.73
7.0.160.0070.00715.54
7.0.150.0030.00615.79
7.0.140.0030.04018.69
7.0.130.0030.01015.58
7.0.120.0110.00315.33
7.0.110.0090.00315.52
7.0.100.0030.01015.73
7.0.90.0060.00315.47
7.0.80.0000.01115.55
7.0.70.0080.00315.18
7.0.60.0030.04017.67
7.0.50.0070.02916.70
7.0.40.0140.03716.97
7.0.30.0180.03516.90
7.0.20.0160.02616.87
7.0.10.0200.04316.92
7.0.00.0050.04516.84
5.6.400.0070.01014.68
5.6.390.0040.01114.68
5.6.380.0000.00914.43
5.6.370.0070.00614.51
5.6.360.0130.00314.85
5.6.350.0000.01114.67
5.6.340.0070.01114.44
5.6.330.0030.00914.38
5.6.320.0030.01214.74
5.6.310.0070.01114.82
5.6.300.0070.00414.72
5.6.290.0070.00714.53
5.6.280.0020.05217.91
5.6.270.0080.00414.62
5.6.260.0040.01114.49
5.6.250.0030.01314.30
5.6.240.0000.01614.65
5.6.230.0110.00414.63
5.6.220.0070.00714.46
5.6.210.0070.03717.62
5.6.200.0030.03016.53
5.6.190.0030.02717.73
5.6.180.1670.02217.43
5.6.170.0130.02817.61
5.6.160.0070.02617.43
5.6.150.0030.02816.46
5.6.140.0070.04016.50
5.6.130.0030.02516.39
5.6.120.0000.03217.72
5.6.110.0080.03817.68
5.6.100.0150.03517.73
5.6.90.0060.02417.75
5.6.80.0020.02717.27
5.6.70.1270.02617.43
5.6.60.0000.01214.37
5.6.50.0000.01414.27
5.6.40.0110.00414.45
5.6.30.0000.01014.37
5.6.20.0060.00614.73
5.6.10.0070.00714.26
5.6.00.0070.00714.38
5.5.380.0070.00714.59
5.5.370.0030.00914.39
5.5.360.0030.01014.42
5.5.350.0070.03017.54
5.5.340.0150.02816.27
5.5.330.0030.02717.42
5.5.320.0200.04517.45
5.5.310.0110.03617.27
5.5.300.0070.04216.33
5.5.290.0100.04016.15
5.5.280.0080.02317.52
5.5.270.0070.02917.56
5.5.260.0030.03617.82
5.5.250.0050.04517.44
5.5.240.0080.03117.29
5.5.230.0030.00914.47
5.5.220.0030.01014.29
5.5.210.0060.01314.33
5.5.200.0100.00714.55
5.5.190.0000.01214.49
5.5.180.0110.00014.48
5.5.170.0070.00714.29
5.5.160.0040.00814.06
5.5.150.0040.01114.45
5.5.140.0040.01114.25
5.5.130.0030.00614.25
5.5.120.0090.00314.29
5.5.110.0100.00314.46
5.5.100.0060.00314.41
5.5.90.0060.00314.17
5.5.80.0070.00614.35
5.5.70.0070.00314.44
5.5.60.0040.00814.23
5.5.50.0060.00914.40
5.5.40.0090.00014.39
5.5.30.0000.01314.08
5.5.20.0030.00914.48
5.5.10.0060.00614.24
5.5.00.0080.00814.32
5.4.450.0350.02815.34
5.4.440.0410.03815.41
5.4.430.0320.03515.43
5.4.420.0200.03515.43
5.4.410.0250.03415.26
5.4.400.0460.00215.05
5.4.390.0430.00315.02
5.4.380.0130.03014.95
5.4.370.0280.02314.83
5.4.360.0130.03214.91
5.4.350.0070.03614.98
5.4.340.0140.02614.97
5.4.330.0060.00611.34
5.4.320.0080.02211.96
5.4.310.0040.02211.95
5.4.300.0030.02311.80
5.4.290.0080.02211.90
5.4.280.0080.02411.66
5.4.270.0050.02411.78
5.4.260.0090.03414.81
5.4.250.0070.03815.03
5.4.240.0030.03115.06
5.4.230.0100.02514.89
5.4.220.0070.04615.20
5.4.210.0080.03215.05
5.4.200.0100.02514.98
5.4.190.0120.02915.04
5.4.180.0070.02714.98
5.4.170.0050.04115.07
5.4.160.0100.02515.19
5.4.150.0120.03215.00
5.4.140.0060.03013.78
5.4.130.0070.02513.90
5.4.120.0150.02713.80
5.4.110.0080.03613.82
5.4.100.0040.02913.85
5.4.90.0020.02813.69
5.4.80.0030.04113.93
5.4.70.0030.03013.74
5.4.60.0050.03013.88
5.4.50.0110.02113.71
5.4.40.0030.03813.88
5.4.30.0110.02513.83
5.4.20.0050.03113.86
5.4.10.0030.03813.74
5.4.00.0030.03413.60
5.3.290.0070.02611.70
5.3.280.0070.03312.61
5.3.270.0080.03412.62
5.3.260.0050.04012.78
5.3.250.0050.03912.73
5.3.240.0030.04112.73
5.3.230.0080.02812.58
5.3.220.0070.03312.63
5.3.210.0090.03812.69
5.3.200.0050.02812.61
5.3.190.0070.02812.67
5.3.180.0050.02712.76
5.3.170.0030.03512.65
5.3.160.0090.03012.77
5.3.150.0080.02512.70
5.3.140.0090.02712.71
5.3.130.0080.03412.51
5.3.120.0100.02312.67
5.3.110.0050.03112.74
5.3.100.0090.03312.32
5.3.90.0110.03312.27
5.3.80.0050.03512.40
5.3.70.0070.02512.33
5.3.60.0130.02012.37
5.3.50.0040.03412.36
5.3.40.0030.03012.33
5.3.30.0020.04012.35
5.3.20.0080.03212.27
5.3.10.0050.02912.03
5.3.00.0080.02511.99
5.2.170.0030.04711.14
5.2.160.0030.04011.39
5.2.150.0100.04011.25
5.2.140.0070.04011.23
5.2.130.0000.04711.29
5.2.120.0100.03311.21
5.2.110.0230.04011.07
5.2.100.0100.03311.11
5.2.90.0000.04710.95
5.2.80.0130.03311.10
5.2.70.0130.04011.10
5.2.60.0100.04310.92
5.2.50.0100.04711.26
5.2.40.0100.04311.00
5.2.30.0070.04010.96
5.2.20.0100.03311.07
5.2.10.0070.04010.97
5.2.00.0070.04010.70
5.1.60.0100.03710.03
5.1.50.0070.04310.00
5.1.40.0030.0439.96
5.1.30.0070.03310.30
5.1.20.0070.03710.35
5.1.10.0100.04710.16
5.1.00.0070.03310.04
5.0.50.0030.0308.65
5.0.40.0000.0378.40
5.0.30.0030.0438.29
5.0.20.0030.0338.32
5.0.10.0070.0338.21
5.0.00.0030.0408.39
4.4.90.0000.0336.39
4.4.80.0100.0136.39
4.4.70.0000.0236.39
4.4.60.0030.0276.39
4.4.50.0030.0236.39
4.4.40.0070.0336.39
4.4.30.0030.0206.39
4.4.20.0000.0236.39
4.4.10.0030.0206.39
4.4.00.0030.0336.39
4.3.110.0030.0236.39
4.3.100.0070.0276.39
4.3.90.0100.0206.39
4.3.80.0000.0336.39
4.3.70.0070.0276.39
4.3.60.0070.0136.39
4.3.50.0070.0276.39
4.3.40.0030.0306.39
4.3.30.0070.0276.39
4.3.20.0030.0306.39
4.3.10.0030.0276.39
4.3.00.0030.0206.97

preferences:
70.48 ms | 401 KiB | 5 Q