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 "<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 => $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.60.0120.00317.13
8.3.50.0120.00422.06
8.3.40.0110.00419.08
8.3.30.0110.00419.12
8.3.20.0050.00320.34
8.3.10.0080.00023.66
8.3.00.0060.00322.32
8.2.180.0200.00325.92
8.2.170.0120.00319.32
8.2.160.0100.01022.96
8.2.150.0030.01324.18
8.2.140.0040.00424.66
8.2.130.0160.00426.16
8.2.120.0050.00322.21
8.2.110.0060.00322.38
8.2.100.0070.00417.97
8.2.90.0040.00419.18
8.2.80.0050.00317.97
8.2.70.0030.00617.84
8.2.60.0040.00417.93
8.2.50.0090.00318.07
8.2.40.0040.00418.28
8.2.30.0040.00418.11
8.2.20.0000.00817.98
8.2.10.0000.00817.93
8.2.00.0040.00418.06
8.1.280.0090.00925.92
8.1.270.0000.00923.88
8.1.260.0000.00926.35
8.1.250.0050.00528.09
8.1.240.0060.00323.84
8.1.230.0070.00419.11
8.1.220.0030.00517.78
8.1.210.0050.00318.77
8.1.200.0060.00617.73
8.1.190.0040.00417.41
8.1.180.0060.00318.10
8.1.170.0050.00318.75
8.1.160.0060.00322.02
8.1.150.0050.00218.89
8.1.140.0040.00417.65
8.1.130.0000.00717.84
8.1.120.0000.00717.64
8.1.110.0040.00417.64
8.1.100.0040.00417.61
8.1.90.0040.00417.63
8.1.80.0000.00717.64
8.1.70.0070.00017.48
8.1.60.0040.00717.73
8.1.50.0030.00617.63
8.1.40.0040.00417.76
8.1.30.0080.00017.79
8.1.20.0030.00517.75
8.1.10.0000.00817.79
8.1.00.0000.00817.63
8.0.300.0000.00818.77
8.0.290.0040.00417.28
8.0.280.0000.00718.42
8.0.270.0000.00717.33
8.0.260.0030.00317.08
8.0.250.0050.00217.20
8.0.240.0020.00517.22
8.0.230.0040.00417.19
8.0.220.0000.00717.06
8.0.210.0000.00717.03
8.0.200.0040.00417.10
8.0.190.0040.00417.23
8.0.180.0060.00317.23
8.0.170.0000.00817.20
8.0.160.0040.00417.20
8.0.150.0040.00417.04
8.0.140.0040.00417.09
8.0.130.0000.00613.58
8.0.120.0040.00416.99
8.0.110.0000.00817.11
8.0.100.0040.00417.03
8.0.90.0000.00717.22
8.0.80.0070.01417.16
8.0.70.0050.00317.02
8.0.60.0030.00517.16
8.0.50.0040.00417.02
8.0.30.0140.00617.30
8.0.20.0120.00717.47
8.0.10.0000.00817.32
8.0.00.0130.00717.06
7.4.330.0050.00015.25
7.4.320.0000.00616.69
7.4.300.0030.00316.74
7.4.290.0040.00416.87
7.4.280.0050.00316.65
7.4.270.0070.00016.88
7.4.260.0040.00416.74
7.4.250.0000.00816.73
7.4.240.0000.00716.81
7.4.230.0070.00016.70
7.4.220.0090.00916.63
7.4.210.0040.01316.87
7.4.200.0000.00716.84
7.4.190.0000.00716.80
7.4.160.0100.00716.70
7.4.150.0130.00517.40
7.4.140.0100.00917.86
7.4.130.0100.01016.80
7.4.120.0060.01216.76
7.4.110.0090.01516.66
7.4.100.0070.01416.64
7.4.90.0150.00816.83
7.4.80.0060.01619.39
7.4.70.0140.00316.79
7.4.60.0110.00816.92
7.4.50.0050.00016.98
7.4.40.0000.01722.77
7.4.30.0110.00616.70
7.4.00.0070.01015.01
7.3.330.0000.00513.45
7.3.320.0030.00313.58
7.3.310.0030.00616.48
7.3.300.0000.00716.53
7.3.290.0090.00616.49
7.3.280.0080.00916.56
7.3.270.0100.00717.40
7.3.260.0080.01616.50
7.3.250.0120.00816.78
7.3.240.0140.00416.55
7.3.230.0120.00616.67
7.3.210.0030.01416.56
7.3.200.0100.01319.39
7.3.190.0060.01216.76
7.3.180.0030.01416.58
7.3.170.0100.01316.66
7.3.160.0110.00516.92
7.3.120.0070.00714.83
7.2.330.0080.01316.88
7.2.320.0160.00316.86
7.2.310.0090.01516.83
7.2.300.0120.00616.84
7.2.290.0150.00316.78
7.1.100.0000.01518.27
7.1.70.0100.00017.20
7.1.60.0090.01619.29
7.1.50.0070.01717.13
7.1.00.0000.08022.41
7.0.200.0100.00317.08
7.0.140.0000.07722.09
7.0.60.0070.07019.96
7.0.50.0100.08717.96
7.0.40.0070.04720.05
7.0.30.0400.06720.08
7.0.20.0370.07320.34
7.0.10.0070.04020.08
7.0.00.0130.08020.22
5.6.280.0070.07021.04
5.6.210.0130.03720.73
5.6.200.0030.04018.29
5.6.190.0170.07720.61
5.6.180.0400.06020.61
5.6.170.0370.07020.40
5.6.160.0100.08020.39
5.6.150.0130.05318.31
5.6.140.0030.06718.32
5.6.130.0170.07718.22
5.6.120.0030.06020.98
5.6.110.0070.08721.13
5.6.100.0030.05721.00
5.6.90.0130.05320.98
5.6.80.0100.07020.54
5.5.350.0030.06720.47
5.5.340.0070.03718.13
5.5.330.0030.08320.35
5.5.320.0030.08020.27
5.5.310.0300.07320.37
5.5.300.0100.04017.98
5.5.290.0070.07318.01
5.5.280.0100.08720.79
5.5.270.0000.05320.90
5.5.260.0070.08320.71
5.5.250.0130.07720.45
5.5.240.0130.06720.05
5.4.450.3800.04019.48
5.4.440.3370.04719.39
5.4.430.3200.02719.47
5.4.420.3000.04019.48
5.4.410.2770.03719.08
5.4.400.3730.03319.23
5.4.390.3970.04719.09
5.4.380.3670.04019.09
5.4.370.4070.03719.23
5.4.360.3630.03718.89
5.4.350.3700.03719.32
5.4.340.3600.03718.86
5.4.320.3470.03019.24
5.4.310.3700.03719.16
5.4.300.3930.04319.01
5.4.290.3670.04319.21
5.4.280.3600.04319.16
5.4.270.3370.04018.99
5.4.260.3770.03319.16
5.4.250.3670.03719.21
5.4.240.4300.04318.94
5.4.230.3670.04319.24
5.4.220.3770.04019.08
5.4.210.3630.04019.05
5.4.200.3670.04019.09
5.4.190.3700.03719.15
5.4.180.3570.02719.21
5.4.170.3030.04018.86
5.4.160.3430.03318.97
5.4.150.3670.03318.93
5.4.140.3670.03316.36
5.4.130.3700.03716.40
5.4.120.3430.03016.39
5.4.110.3300.04016.41
5.4.100.3600.03316.59
5.4.90.3730.03016.61
5.4.80.0070.05016.62
5.4.70.4300.04016.57
5.4.60.4300.03716.17
5.4.50.3800.03316.42
5.4.40.3470.03016.25
5.4.30.3570.03716.54
5.4.20.3300.03716.42
5.4.10.3600.03716.53
5.4.00.3600.03715.95
5.3.290.3530.03014.59
5.3.280.3770.05014.60
5.3.270.3430.04314.55
5.3.260.3630.03014.68
5.3.250.3330.04014.74
5.3.240.4000.04714.71
5.3.230.3730.03314.73
5.3.220.3430.04314.59
5.3.210.3370.04014.56
5.3.200.3530.03714.81
5.3.190.0000.04314.68
5.3.180.0100.07014.50
5.3.170.2300.05714.80
5.3.160.4100.03314.74
5.3.150.3770.02714.67
5.3.140.3870.03314.55
5.3.130.3630.03714.54
5.3.120.3700.03314.62
5.3.110.3730.03014.73
5.3.100.3830.03314.03
5.3.90.3530.03713.95
5.3.80.3500.03313.95
5.3.70.4330.03014.26
5.3.60.4330.03314.18
5.3.50.1870.03313.88
5.3.40.0070.03314.06
5.3.30.3800.04714.02
5.3.20.3530.03713.64
5.3.10.3500.03013.68
5.3.00.4670.04313.66
5.2.170.0100.03711.26
5.2.160.0030.06011.13
5.2.150.2270.03011.11
5.2.140.3270.03311.26
5.2.130.3100.02711.36
5.2.120.3000.02311.06
5.2.110.2830.02311.20
5.2.100.3570.03711.05
5.2.90.3500.02011.04
5.2.80.3570.03311.05
5.2.70.3600.03011.04
5.2.60.3100.02711.12
5.2.50.3270.03711.05
5.2.40.2400.02711.12
5.2.30.2370.03010.90
5.2.20.2430.03711.04
5.2.10.2370.03010.86
5.2.00.2330.02710.70
5.1.60.2300.02310.11
5.1.50.2330.02310.11
5.1.40.2000.02710.09
5.1.30.2330.02710.28
5.1.20.2370.02310.31
5.1.10.2900.03310.08
5.1.00.2700.02710.15
5.0.50.1170.0178.46
5.0.40.1230.0278.43
5.0.30.1270.0308.16
5.0.20.1400.0208.17
5.0.10.1330.0208.33
5.0.00.1570.0378.12
4.4.90.1330.0176.91
4.4.80.1200.0136.91
4.4.70.1200.0136.94
4.4.60.1170.0136.95
4.4.50.1200.0106.95
4.4.40.1200.0236.98
4.4.30.0900.0136.98
4.4.20.1330.0207.01
4.4.10.1130.0177.05
4.4.00.1170.0237.09
4.3.110.1170.0137.09
4.3.100.1130.0137.09
4.3.90.1470.0137.12
4.3.80.1700.0277.15
4.3.70.1370.0137.15
4.3.60.1430.0137.16
4.3.50.1600.0207.16
4.3.40.1530.0237.16
4.3.30.0700.0177.16
4.3.20.0900.0237.16
4.3.10.0900.0207.16
4.3.00.0900.0207.16

preferences:
41.79 ms | 401 KiB | 5 Q