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() { $regexatt = '/\<table class="ad-attributes">(.*)\<\/table\>/'; preg_match($regexatt, $this->html, $matches); $a = $matches[1]; $regexcontent = '/\<div id="UserContent">(.*)\<\/div\>/'; preg_match($regexcontent, $this->html, $matches); $b = $matches[1]; return $a . $b; } } class HTMLReader { function getHTML($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"') { return "<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 { return 'dhoaudg od oaeywgdoad <table class="ad-attributes">yesser</table> dfdssd <div id="UserContent">good</div> dfdfdf df df'; } } } $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)); foreach ($liste->getURLs() as $line_num => $line) { $htmlfiche = $reader->getHTML($line); $ad_info = new AdInfoExtractor($htmlfiche); $mail_html = $mail_html . $ad_info->getHMTL(); 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.40.0120.00319.03
8.3.30.0030.01219.27
8.3.20.0070.00020.35
8.3.10.0040.00421.92
8.3.00.0050.00322.44
8.2.170.0090.00622.96
8.2.160.0110.00419.46
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.86
8.2.110.0070.00322.23
8.2.100.0080.00419.85
8.2.90.0080.00019.16
8.2.80.0050.00317.97
8.2.70.0000.00917.88
8.2.60.0040.00417.77
8.2.50.0000.00818.07
8.2.40.0060.00318.28
8.2.30.0030.00518.26
8.2.20.0030.00518.10
8.2.10.0070.00017.90
8.2.00.0040.00418.07
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.64
8.1.230.0110.00019.19
8.1.220.0000.00818.03
8.1.210.0030.00618.77
8.1.200.0030.00717.60
8.1.190.0000.00817.78
8.1.180.0030.00618.86
8.1.170.0050.00318.62
8.1.160.0000.00822.30
8.1.150.0000.00818.91
8.1.140.0040.00417.60
8.1.130.0000.00717.82
8.1.120.0000.00717.75
8.1.110.0060.00317.66
8.1.100.0040.00417.70
8.1.90.0030.00517.65
8.1.80.0040.00417.68
8.1.70.0000.00817.54
8.1.60.0030.00617.77
8.1.50.0000.00817.63
8.1.40.0000.00817.67
8.1.30.0030.00617.90
8.1.20.0080.00017.71
8.1.10.0080.00017.83
8.1.00.0040.00417.70
8.0.300.0000.00818.77
8.0.290.0040.00417.18
8.0.280.0070.00018.44
8.0.270.0000.00717.35
8.0.260.0020.00517.09
8.0.250.0070.00017.27
8.0.240.0040.00417.27
8.0.230.0000.00717.19
8.0.220.0080.00017.12
8.0.210.0030.00317.17
8.0.200.0070.00017.14
8.0.190.0030.00617.21
8.0.180.0080.00017.04
8.0.170.0000.00817.01
8.0.160.0000.00717.20
8.0.150.0000.00817.13
8.0.140.0050.00217.15
8.0.130.0000.00613.61
8.0.120.0000.00817.17
8.0.110.0040.00417.07
8.0.100.0040.00417.17
8.0.90.0040.00417.14
8.0.80.0030.01417.22
8.0.70.0000.00817.17
8.0.60.0000.00717.11
8.0.50.0000.00717.05
8.0.30.0090.01417.20
8.0.20.0070.01317.40
8.0.10.0040.00417.18
8.0.00.0120.00616.88
7.4.330.0030.00315.17
7.4.320.0050.00316.79
7.4.300.0030.00316.77
7.4.290.0030.00316.76
7.4.280.0030.00616.90
7.4.270.0040.00416.89
7.4.260.0030.00516.86
7.4.250.0040.00416.74
7.4.240.0040.00416.87
7.4.230.0070.00016.68
7.4.220.0090.00916.95
7.4.210.0080.00916.87
7.4.200.0000.00816.77
7.4.190.0000.00716.94
7.4.160.0030.01316.89
7.4.150.0050.01417.40
7.4.140.0110.00817.86
7.4.130.0110.00916.80
7.4.120.0090.01016.92
7.4.110.0080.01516.89
7.4.100.0070.01116.88
7.4.90.0100.01416.72
7.4.80.0090.01619.39
7.4.70.0110.01116.57
7.4.60.0120.01116.81
7.4.50.0030.00616.83
7.4.40.0070.00722.77
7.4.30.0130.00816.95
7.4.10.0090.01015.31
7.4.00.0090.00915.09
7.3.330.0030.00313.56
7.3.320.0000.00613.52
7.3.310.0000.00716.60
7.3.300.0030.00316.55
7.3.290.0070.00716.53
7.3.280.0070.01116.49
7.3.270.0120.00617.40
7.3.260.0140.00616.77
7.3.250.0090.00816.66
7.3.240.0140.00316.76
7.3.230.0120.01216.56
7.3.210.0060.01216.56
7.3.200.0050.01116.75
7.3.190.0110.00716.81
7.3.180.0110.00716.81
7.3.170.0110.00716.73
7.3.160.0130.00316.60
7.3.130.0050.01414.97
7.3.120.0080.01015.02
7.3.110.0110.00615.21
7.3.100.0030.01414.83
7.3.90.0080.00515.09
7.3.80.0080.00714.94
7.3.70.0050.00915.09
7.3.60.0070.00615.04
7.3.50.0080.00714.89
7.3.40.0090.00515.05
7.3.30.0060.00715.12
7.3.20.0050.00816.85
7.3.10.0090.00616.83
7.3.00.0090.00716.91
7.2.330.0150.00416.91
7.2.320.0100.00716.86
7.2.310.0100.01016.95
7.2.300.0070.01017.04
7.2.290.0100.00716.91
7.2.260.0110.00615.44
7.2.250.0070.01015.42
7.2.240.0070.00915.26
7.2.230.0070.00815.26
7.2.220.0080.00715.27
7.2.210.0070.01015.39
7.2.200.0050.01215.16
7.2.190.0030.01215.18
7.2.180.0070.00815.30
7.2.170.0050.01115.36
7.2.160.0110.00515.28
7.2.150.0070.00817.11
7.2.140.0080.00517.13
7.2.130.0090.00517.20
7.2.120.0070.00717.22
7.2.110.0090.00717.04
7.2.100.0060.00917.23
7.2.90.0050.00917.26
7.2.80.0060.00717.07
7.2.70.0030.01017.00
7.2.60.0070.01117.06
7.2.50.0080.00916.89
7.2.40.0050.01317.10
7.2.30.0090.00917.14
7.2.20.0030.01117.13
7.2.10.0080.01017.20
7.2.00.0070.00817.15
7.1.330.0050.00915.94
7.1.320.0060.00816.01
7.1.310.0080.00616.06
7.1.300.0060.00915.84
7.1.290.0070.00616.07
7.1.280.0050.01116.04
7.1.270.0050.00716.00
7.1.260.0080.00715.93
7.1.250.0050.00916.13
7.1.240.0050.00715.93
7.1.230.0060.00715.95
7.1.220.0050.01115.96
7.1.210.0050.00715.89
7.1.200.0060.00915.87
7.1.190.0050.00816.01
7.1.180.0030.01016.02
7.1.170.0030.01015.85
7.1.160.0060.00815.97
7.1.150.0050.01116.07
7.1.140.0050.00716.17
7.1.130.0040.00716.18
7.1.120.0080.00516.07
7.1.110.0110.00415.96
7.1.100.0070.00715.85
7.1.90.0030.00915.96
7.1.80.0050.01015.83
7.1.70.0090.00916.42
7.1.60.0050.01117.29
7.1.50.0080.01216.46
7.1.40.0110.00416.02
7.1.30.0050.00916.12
7.1.20.0020.01315.98
7.1.10.0010.01116.08
7.1.00.0070.03518.16
7.0.330.0050.00815.54
7.0.320.0040.00715.37
7.0.310.0050.00915.53
7.0.300.0030.00915.56
7.0.290.0050.00915.60
7.0.280.0100.00315.63
7.0.270.0060.00715.66
7.0.260.0110.00315.65
7.0.250.0020.01015.65
7.0.240.0070.00415.80
7.0.230.0070.00515.81
7.0.220.0090.00515.79
7.0.210.0060.00715.55
7.0.200.0050.01116.13
7.0.190.0040.00915.75
7.0.180.0080.00815.62
7.0.170.0030.01215.62
7.0.160.0020.01115.63
7.0.150.0050.00815.47
7.0.140.0040.03117.85
7.0.130.0000.01015.62
7.0.120.0050.00515.59
7.0.110.0060.00615.42
7.0.100.0020.00915.58
7.0.90.0070.00515.67
7.0.80.0060.00515.59
7.0.70.0060.00715.60
7.0.60.0050.03417.09
7.0.50.0080.02016.46
7.0.40.0070.03115.95
7.0.30.0140.03115.81
7.0.20.0120.02315.83
7.0.10.0110.02815.81
7.0.00.0080.02115.76
5.6.400.0050.00914.76
5.6.390.0090.00614.32
5.6.380.0020.01214.49
5.6.370.0070.00614.33
5.6.360.0040.01014.72
5.6.350.0050.01014.38
5.6.340.0040.01114.42
5.6.330.0090.00614.77
5.6.320.0100.00414.68
5.6.310.0060.00914.64
5.6.300.0100.00514.68
5.6.290.0030.00714.31
5.6.280.0080.02616.63
5.6.270.0100.00514.68
5.6.260.0050.00414.58
5.6.250.0040.00914.47
5.6.240.0030.00914.47
5.6.230.0120.00114.62
5.6.220.0060.00814.33
5.6.210.0080.03116.55
5.6.200.0070.01815.76
5.6.190.0100.02616.54
5.6.180.1330.01716.49
5.6.170.0150.02116.63
5.6.160.0070.03016.51
5.6.150.0090.02915.68
5.6.140.0110.02415.77
5.6.130.0090.02315.76
5.6.120.0080.03416.68
5.6.110.0120.02916.56
5.6.100.0110.03016.83
5.6.90.0090.02916.50
5.6.80.0080.02016.46
5.6.70.1540.01916.45
5.6.60.0050.00914.41
5.6.50.0040.00814.54
5.6.40.0110.00214.46
5.6.30.0030.00814.45
5.6.20.0080.00614.47
5.6.10.0060.00614.44
5.6.00.0050.00914.39
5.5.380.0050.00714.29
5.5.370.0010.01114.37
5.5.360.0050.00814.58
5.5.350.0070.02016.32
5.5.340.0040.03215.68
5.5.330.0030.03116.58
5.5.320.0070.02116.35
5.5.310.0110.03216.48
5.5.300.0070.03315.68
5.5.290.0050.02015.61
5.5.280.0060.03516.67
5.5.270.0040.02216.68
5.5.260.0080.03116.51
5.5.250.0060.01716.44
5.5.240.0090.03116.32
5.5.230.0020.01214.38
5.5.220.0050.00814.35
5.5.210.0080.00614.54
5.5.200.0090.00814.44
5.5.190.0060.00914.16
5.5.180.0080.00514.43
5.5.170.0100.00314.41
5.5.160.0080.00414.34
5.5.150.0060.00514.43
5.5.140.0050.01014.40
5.5.130.0060.01014.54
5.5.120.0060.00614.41
5.5.110.0090.00514.40
5.5.100.0060.00514.56
5.5.90.0050.00814.37
5.5.80.0040.00914.42
5.5.70.0050.01014.41
5.5.60.0040.00814.33
5.5.50.0060.00614.63
5.5.40.0050.00814.34
5.5.30.0080.00514.34
5.5.20.0050.00914.43
5.5.10.0030.00814.46
5.5.00.0060.00814.49
5.4.450.0170.02614.51
5.4.440.0210.02314.41
5.4.430.0240.02014.36
5.4.420.0200.02314.53
5.4.410.0230.02214.46
5.4.400.0570.00514.14
5.4.390.0280.00314.23
5.4.380.0090.02514.16
5.4.370.0270.02014.15
5.4.360.0260.02414.23
5.4.350.0320.01514.18
5.4.340.0290.02014.22
5.4.330.0040.00411.95
5.4.320.0040.01812.14
5.4.310.0050.01712.14
5.4.300.0040.01712.14
5.4.290.0040.02012.14
5.4.280.0060.01412.11
5.4.270.0030.01912.11
5.4.260.0050.02014.28
5.4.250.0070.02014.21
5.4.240.0060.03014.27
5.4.230.0010.02514.21
5.4.220.0040.02414.22
5.4.210.0010.02514.29
5.4.200.0110.01814.27
5.4.190.0040.02214.28
5.4.180.0040.02514.29
5.4.170.0080.02214.28
5.4.160.0080.02514.28
5.4.150.0030.02314.21
5.4.140.0060.02113.45
5.4.130.0060.02013.46
5.4.120.0060.02613.50
5.4.110.0040.02213.49
5.4.100.0030.02313.49
5.4.90.0060.02013.46
5.4.80.0020.02413.47
5.4.70.0060.02213.42
5.4.60.0030.03013.46
5.4.50.0070.01913.43
5.4.40.0030.02513.50
5.4.30.0050.02113.45
5.4.20.0060.02413.47
5.4.10.0080.02213.46
5.4.00.0060.02013.31
5.3.290.0040.01812.24
5.3.280.0060.01812.92
5.3.270.0090.02112.89
5.3.260.0110.02012.90
5.3.250.0020.02412.90
5.3.240.0030.02312.87
5.3.230.0100.01612.87
5.3.220.0050.02112.86
5.3.210.0120.01712.84
5.3.200.0030.02312.80
5.3.190.0050.02112.77
5.3.180.0050.02112.82
5.3.170.0040.02012.86
5.3.160.0030.02312.83
5.3.150.0070.02212.89
5.3.140.0100.02412.86
5.3.130.0060.02012.81
5.3.120.0050.02912.85
5.3.110.0040.02312.83
5.3.100.0050.02212.66
5.3.90.0050.02412.65
5.3.80.0060.02112.60
5.3.70.0030.03112.68
5.3.60.0050.02612.63
5.3.50.0040.02712.66
5.3.40.0030.02312.59
5.3.30.0060.02212.61
5.3.20.0040.02112.60
5.3.10.0040.02012.58
5.3.00.0060.02312.55
5.2.170.0030.04311.24
5.2.160.0070.04011.15
5.2.150.0130.05311.23
5.2.140.0100.04011.07
5.2.130.0000.04311.11
5.2.120.0000.04311.11
5.2.110.0070.04011.21
5.2.100.0170.03311.21
5.2.90.0070.03711.29
5.2.80.0100.03711.12
5.2.70.0130.03711.34
5.2.60.0070.04011.16
5.2.50.0030.04310.88
5.2.40.0070.05010.86
5.2.30.0070.04711.10
5.2.20.0030.04010.96
5.2.10.0070.03710.96
5.2.00.0070.04010.66
5.1.60.0070.05010.09
5.1.50.0070.0339.99
5.1.40.0030.03310.25
5.1.30.0030.05310.31
5.1.20.0130.03010.60
5.1.10.0030.0409.93
5.1.00.0100.04310.19
5.0.50.0000.0308.65
5.0.40.0100.0278.43
5.0.30.0000.0478.42
5.0.20.0100.0338.47
5.0.10.0070.0278.31
5.0.00.0030.0508.26
4.4.90.0030.0206.28
4.4.80.0030.0276.28
4.4.70.0030.0206.28
4.4.60.0100.0176.28
4.4.50.0030.0236.28
4.4.40.0070.0436.28
4.4.30.0070.0176.28
4.4.20.0070.0176.28
4.4.10.0030.0206.27
4.4.00.0000.0376.27
4.3.110.0100.0176.28
4.3.100.0000.0236.28
4.3.90.0070.0236.28
4.3.80.0030.0336.28
4.3.70.0070.0176.28
4.3.60.0070.0236.28
4.3.50.0100.0206.28
4.3.40.0070.0306.28
4.3.30.0070.0176.28
4.3.20.0030.0206.28
4.3.10.0030.0306.28
4.3.00.0070.0237.10

preferences:
52.08 ms | 400 KiB | 5 Q