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() { echo '------'.$this->html; $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 "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 { return 'fiche <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 => $line2) { $htmlfiche = $reader->getHTML($line2); $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.70.0100.01418.81
8.3.60.0090.01218.81
8.3.50.0070.00922.11
8.3.40.0170.00319.21
8.3.30.0190.00320.47
8.3.20.0040.00420.34
8.3.10.0070.01122.10
8.3.00.0200.00022.44
8.2.190.0120.00316.85
8.2.180.0110.01118.91
8.2.170.0080.01122.96
8.2.160.0070.00720.66
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0100.01026.16
8.2.120.0080.00019.69
8.2.110.0060.00322.37
8.2.100.0000.01119.34
8.2.90.0000.00819.40
8.2.80.0000.00819.32
8.2.70.0060.00617.88
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0030.00618.03
8.2.30.0060.00318.12
8.2.20.0000.00818.09
8.2.10.0000.00818.09
8.2.00.0050.00318.01
8.1.280.0120.00625.92
8.1.270.0120.00324.66
8.1.260.0070.01026.35
8.1.250.0110.00728.09
8.1.240.0060.00323.97
8.1.230.0060.00619.29
8.1.220.0000.00817.91
8.1.210.0060.00318.77
8.1.200.0090.00017.61
8.1.190.0000.00817.61
8.1.180.0040.00419.26
8.1.170.0000.00918.83
8.1.160.0000.00822.22
8.1.150.0070.00018.83
8.1.140.0000.00917.65
8.1.130.0040.00417.81
8.1.120.0000.00817.66
8.1.110.0000.00817.55
8.1.100.0040.00417.70
8.1.90.0050.00317.63
8.1.80.0030.00517.65
8.1.70.0040.00417.62
8.1.60.0030.00617.82
8.1.50.0040.00417.62
8.1.40.0000.00817.70
8.1.30.0000.00817.81
8.1.20.0030.00517.80
8.1.10.0060.00317.78
8.1.00.0030.00517.54
8.0.300.0070.00018.77
8.0.290.0000.00717.18
8.0.280.0000.00718.52
8.0.270.0040.00417.25
8.0.260.0070.00017.08
8.0.250.0030.00317.12
8.0.240.0030.00617.11
8.0.230.0050.00317.11
8.0.220.0030.00317.15
8.0.210.0070.00017.05
8.0.200.0000.00717.10
8.0.190.0000.00917.13
8.0.180.0000.00717.15
8.0.170.0040.00417.06
8.0.160.0000.00717.00
8.0.150.0020.00517.18
8.0.140.0030.00616.96
8.0.130.0060.00013.57
8.0.120.0040.00417.14
8.0.110.0040.00417.06
8.0.100.0000.00817.10
8.0.90.0000.00717.15
8.0.80.0070.01017.11
8.0.70.0040.00417.20
8.0.60.0040.00417.22
8.0.50.0030.00517.16
8.0.30.0090.01517.42
8.0.20.0110.00817.40
8.0.10.0030.00517.37
8.0.00.0150.00817.02
7.4.330.0050.00015.00
7.4.320.0000.00716.63
7.4.300.0060.00016.78
7.4.290.0000.00816.72
7.4.280.0020.00516.86
7.4.270.0030.00516.63
7.4.260.0040.00416.82
7.4.250.0040.00416.86
7.4.240.0060.00116.69
7.4.230.0030.00316.95
7.4.220.0070.01116.94
7.4.210.0070.00916.97
7.4.200.0030.00516.85
7.4.190.0050.00316.96
7.4.160.0110.00816.80
7.4.150.0070.01117.40
7.4.140.0150.01017.86
7.4.130.0050.01216.85
7.4.120.0120.00516.91
7.4.110.0160.00616.80
7.4.100.0150.00816.88
7.4.90.0160.00316.87
7.4.80.0070.01019.39
7.4.70.0040.01516.87
7.4.60.0050.01416.72
7.4.50.0000.00516.62
7.4.40.0060.00622.77
7.4.30.0120.00616.79
7.4.10.0160.00315.25
7.4.00.0020.01815.20
7.3.330.0030.00313.67
7.3.320.0050.00013.62
7.3.310.0030.00316.54
7.3.300.0070.00016.49
7.3.290.0120.00416.54
7.3.280.0100.00816.50
7.3.270.0090.00917.40
7.3.260.0160.00416.79
7.3.250.0120.01016.69
7.3.240.0070.01116.79
7.3.230.0050.01316.76
7.3.210.0060.01216.70
7.3.200.0050.01819.39
7.3.190.0060.01216.58
7.3.180.0030.01416.86
7.3.170.0080.00816.60
7.3.160.0030.01416.75
7.3.130.0090.00915.00
7.3.120.0110.00515.11
7.3.110.0000.02115.14
7.3.100.0100.00714.89
7.3.90.0090.00615.16
7.3.80.0090.00414.98
7.3.70.0070.00715.07
7.3.60.0080.00815.05
7.3.50.0110.00015.16
7.3.40.0030.00815.17
7.3.30.0070.00715.13
7.3.20.0090.00616.61
7.3.10.0080.00616.95
7.3.00.0040.01416.89
7.2.330.0060.01216.88
7.2.320.0070.01116.94
7.2.310.0070.01016.90
7.2.300.0070.01016.76
7.2.290.0100.00716.81
7.2.260.0000.01915.05
7.2.250.0040.01515.04
7.2.240.0030.01315.19
7.2.230.0040.01415.21
7.2.220.0000.01315.24
7.2.210.0030.01215.28
7.2.200.0030.01015.35
7.2.190.0070.01015.47
7.2.180.0040.01115.42
7.2.170.0090.00615.30
7.2.160.0060.00915.55
7.2.150.0100.00017.08
7.2.140.0030.00717.23
7.2.130.0040.01116.88
7.2.120.0040.01117.34
7.2.110.0030.01117.13
7.2.100.0000.00917.16
7.2.90.0030.00617.34
7.2.80.0060.00617.14
7.2.70.0060.01017.02
7.2.60.0060.00517.23
7.2.50.0130.00717.17
7.2.40.0040.01117.04
7.2.30.0080.00816.98
7.2.20.0040.00817.09
7.2.10.0070.00717.22
7.2.00.0040.00717.24
7.1.330.0090.00615.91
7.1.320.0040.01216.10
7.1.310.0100.00315.76
7.1.300.0040.00816.19
7.1.290.0050.00616.06
7.1.280.0030.00815.96
7.1.270.0070.00716.13
7.1.260.0030.00616.14
7.1.250.0000.01415.93
7.1.240.0060.00316.17
7.1.230.0060.00916.04
7.1.220.0030.01016.05
7.1.210.0070.01016.21
7.1.200.0030.00915.94
7.1.190.0090.00316.06
7.1.180.0000.00915.95
7.1.170.0040.00815.91
7.1.160.0080.00416.07
7.1.150.0030.00616.20
7.1.140.0100.00616.22
7.1.130.0040.00415.71
7.1.120.0060.00616.14
7.1.110.0000.01616.14
7.1.100.0050.00516.05
7.1.90.0030.01016.07
7.1.80.0080.00416.18
7.1.70.0020.00916.82
7.1.60.0050.01517.77
7.1.50.0130.00516.65
7.1.40.0030.00716.03
7.1.30.0130.00316.21
7.1.20.0090.00616.04
7.1.10.0110.00015.97
7.1.00.0050.03319.19
7.0.330.0070.00715.70
7.0.320.0000.01215.72
7.0.310.0120.00615.69
7.0.300.0090.00315.41
7.0.290.0030.01015.45
7.0.280.0000.00815.48
7.0.270.0070.00715.63
7.0.260.0000.01215.64
7.0.250.0070.00715.67
7.0.240.0030.00915.72
7.0.230.0030.00715.37
7.0.220.0000.01315.59
7.0.210.0030.00915.46
7.0.200.0030.00716.25
7.0.190.0080.00015.47
7.0.180.0070.01115.74
7.0.170.0090.00615.52
7.0.160.0070.00715.71
7.0.150.0040.00715.57
7.0.140.0120.03518.81
7.0.130.0060.01015.75
7.0.120.0060.00615.24
7.0.110.0060.00615.47
7.0.100.0070.00315.43
7.0.90.0050.00515.78
7.0.80.0090.00615.75
7.0.70.0040.01215.59
7.0.60.0040.03217.82
7.0.50.0050.04516.93
7.0.40.0130.02816.96
7.0.30.0160.02816.95
7.0.20.0200.02217.00
7.0.10.0100.04017.04
7.0.00.0000.03717.01
5.6.400.0080.00414.18
5.6.390.0040.01114.73
5.6.380.0050.00814.84
5.6.370.0030.01214.45
5.6.360.0030.01314.86
5.6.350.0070.00714.82
5.6.340.0070.00714.41
5.6.330.0090.00014.30
5.6.320.0030.00614.19
5.6.310.0030.00914.69
5.6.300.0030.01014.74
5.6.290.0000.01414.36
5.6.280.0070.04017.77
5.6.270.0000.01514.45
5.6.260.0040.00714.45
5.6.250.0030.01014.47
5.6.240.0100.00314.86
5.6.230.0030.01014.52
5.6.220.0030.01114.31
5.6.210.0090.03517.52
5.6.200.0150.03916.41
5.6.190.0120.04617.51
5.6.180.0170.02017.49
5.6.170.0130.02717.52
5.6.160.0120.02917.80
5.6.150.0080.04516.50
5.6.140.0070.04516.41
5.6.130.0030.03116.32
5.6.120.0050.04917.73
5.6.110.0040.03317.68
5.6.100.0060.03117.76
5.6.90.0160.03517.84
5.6.80.0100.02617.44
5.6.70.0100.00714.47
5.6.60.0000.00814.40
5.6.50.0030.01014.26
5.6.40.0040.01114.56
5.6.30.0060.00814.72
5.6.20.0040.00714.52
5.6.10.0110.00614.58
5.6.00.0120.00314.16
5.5.380.0040.00814.31
5.5.370.0100.00714.17
5.5.360.0040.00414.73
5.5.350.0170.04017.45
5.5.340.0080.04416.35
5.5.330.0100.02417.35
5.5.320.0130.02517.50
5.5.310.0200.04417.23
5.5.300.0070.03716.24
5.5.290.0070.03016.23
5.5.280.0070.04717.63
5.5.270.0090.04217.44
5.5.260.0050.03317.50
5.5.250.0080.04317.56
5.5.240.0170.03617.43
5.5.230.0090.00314.61
5.5.220.0030.00714.34
5.5.210.0100.00314.29
5.5.200.0060.00614.59
5.5.190.0110.00414.30
5.5.180.0030.01014.48
5.5.170.0130.00314.47
5.5.160.0040.00714.50
5.5.150.0120.00614.36
5.5.140.0040.00814.32
5.5.130.0030.00614.43
5.5.120.0030.00914.09
5.5.110.0060.00614.52
5.5.100.0000.00914.50
5.5.90.0070.00714.36
5.5.80.0070.00714.47
5.5.70.0100.00014.29
5.5.60.0090.00614.31
5.5.50.0100.00314.35
5.5.40.0060.00314.52
5.5.30.0060.00614.38
5.5.20.0100.00314.17
5.5.10.0000.01014.54
5.5.00.0000.01314.33
5.4.450.0100.02515.19
5.4.440.0470.03415.26
5.4.430.0450.02715.32
5.4.420.0490.02515.31
5.4.410.0170.02515.29
5.4.400.0130.02114.97
5.4.390.0100.02615.06
5.4.380.0260.02315.07
5.4.370.0230.03014.74
5.4.360.0280.02614.94
5.4.350.0170.02914.78
5.4.340.0250.03214.93
5.4.330.0030.01011.03
5.4.320.0060.02211.95
5.4.310.0030.02511.96
5.4.300.0050.02011.97
5.4.290.0060.01911.81
5.4.280.0010.02411.76
5.4.270.0070.01911.85
5.4.260.0130.02715.03
5.4.250.0090.02915.00
5.4.240.0020.03514.97
5.4.230.0060.02815.20
5.4.220.0130.03314.98
5.4.210.0100.03515.15
5.4.200.0030.03314.93
5.4.190.0110.03814.91
5.4.180.0060.02615.07
5.4.170.0060.03014.98
5.4.160.0150.02615.00
5.4.150.0070.03014.93
5.4.140.0100.02813.85
5.4.130.0080.03713.70
5.4.120.0090.02613.73
5.4.110.0070.03513.91
5.4.100.0080.02613.85
5.4.90.0110.03113.87
5.4.80.0080.02313.95
5.4.70.0070.02813.87
5.4.60.0030.04313.83
5.4.50.0090.02513.90
5.4.40.0080.02913.93
5.4.30.0080.02813.79
5.4.20.0040.03113.86
5.4.10.0000.03713.83
5.4.00.0060.03813.56
5.3.290.0040.02411.82
5.3.280.0060.03312.50
5.3.270.0020.04812.50
5.3.260.0090.03012.77
5.3.250.0100.02712.77
5.3.240.0120.03212.65
5.3.230.0070.03012.71
5.3.220.0050.03212.61
5.3.210.0080.03112.71
5.3.200.0070.02912.63
5.3.190.0100.03012.56
5.3.180.0070.03212.63
5.3.170.0050.03112.69
5.3.160.0030.03112.67
5.3.150.0070.03212.55
5.3.140.0080.02812.55
5.3.130.0090.02712.61
5.3.120.0080.02912.61
5.3.110.0100.02512.68
5.3.100.0090.02612.44
5.3.90.0120.02512.46
5.3.80.0100.02712.36
5.3.70.0090.02612.38
5.3.60.0080.03012.31
5.3.50.0060.02912.38
5.3.40.0060.03012.37
5.3.30.0060.02512.30
5.3.20.0070.03112.12
5.3.10.0100.02812.04
5.3.00.0060.02812.10
5.2.170.0130.04011.23
5.2.160.0100.03711.25
5.2.150.0030.04311.25
5.2.140.0070.04011.39
5.2.130.0070.05311.21
5.2.120.0030.04311.35
5.2.110.0130.03711.10
5.2.100.0030.05011.29
5.2.90.0070.05711.10
5.2.80.0130.05011.02
5.2.70.0100.03710.95
5.2.60.0100.04011.15
5.2.50.0030.04311.11
5.2.40.0030.05711.11
5.2.30.0070.04010.91
5.2.20.0170.02710.97
5.2.10.0000.04310.80
5.2.00.0030.04010.73
5.1.60.0030.04710.27
5.1.50.0030.04010.03
5.1.40.0070.0379.94
5.1.30.0030.03710.44
5.1.20.0070.03310.45
5.1.10.0030.03710.12
5.1.00.0030.03710.07
5.0.50.0000.0338.56
5.0.40.0000.0308.51
5.0.30.0070.0408.23
5.0.20.0070.0238.22
5.0.10.0070.0308.41
5.0.00.0000.0438.29
4.4.90.0100.0237.33
4.4.80.0000.0307.33
4.4.70.0030.0207.33
4.4.60.0030.0307.33
4.4.50.0030.0277.33
4.4.40.0070.0277.33
4.4.30.0030.0207.33
4.4.20.0070.0177.33
4.4.10.0100.0137.33
4.4.00.0030.0307.33
4.3.110.0000.0307.33
4.3.100.0030.0207.33
4.3.90.0030.0307.33
4.3.80.0000.0377.33
4.3.70.0000.0237.33
4.3.60.0070.0177.33
4.3.50.0030.0207.33
4.3.40.0100.0237.33
4.3.30.0000.0237.33
4.3.20.0070.0177.33
4.3.10.0030.0207.33
4.3.00.0100.01314.48

preferences:
65.71 ms | 401 KiB | 5 Q