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 getHMTL($url) { 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->getHMTL($line)); foreach ($liste->getURLs() as $line_num => $line) { $htmlfiche = $reader->getHMTL($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.60.0060.00918.55
8.3.50.0070.01522.11
8.3.40.0090.00619.26
8.3.30.0040.01519.27
8.3.20.0000.00820.21
8.3.10.0080.00022.09
8.3.00.0030.00522.40
8.2.180.0120.00617.00
8.2.170.0090.00622.96
8.2.160.0070.00722.43
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0080.00019.73
8.2.110.0040.00420.23
8.2.100.0040.00817.74
8.2.90.0040.00419.27
8.2.80.0000.00818.05
8.2.70.0000.00917.75
8.2.60.0040.00418.15
8.2.50.0000.00818.13
8.2.40.0000.00818.41
8.2.30.0000.00818.22
8.2.20.0030.00518.04
8.2.10.0030.00517.95
8.2.00.0000.00818.09
8.1.280.0070.00725.92
8.1.270.0090.00623.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0140.00421.99
8.1.230.0080.00321.15
8.1.220.0050.00317.91
8.1.210.0080.00018.77
8.1.200.0040.00817.60
8.1.190.0040.00417.53
8.1.180.0000.00818.96
8.1.170.0040.00418.97
8.1.160.0040.00422.30
8.1.150.0070.00018.92
8.1.140.0040.00417.51
8.1.130.0100.00017.60
8.1.120.0040.00417.61
8.1.110.0030.00617.74
8.1.100.0040.00417.61
8.1.90.0050.00317.66
8.1.80.0070.00017.71
8.1.70.0040.00417.60
8.1.60.0030.00617.76
8.1.50.0030.00517.71
8.1.40.0000.00817.71
8.1.30.0000.00917.85
8.1.20.0000.00817.88
8.1.10.0000.00817.79
8.1.00.0060.00317.63
8.0.300.0040.00418.77
8.0.290.0040.00417.30
8.0.280.0070.00018.54
8.0.270.0040.00417.10
8.0.260.0030.00317.17
8.0.250.0030.00317.26
8.0.240.0000.00717.14
8.0.230.0000.00717.19
8.0.220.0000.00717.15
8.0.210.0000.00717.18
8.0.200.0050.00317.29
8.0.190.0000.00817.16
8.0.180.0040.00417.09
8.0.170.0040.00417.23
8.0.160.0080.00017.11
8.0.150.0000.00717.08
8.0.140.0000.00717.20
8.0.130.0030.00313.62
8.0.120.0000.00817.11
8.0.110.0030.00617.15
8.0.100.0040.00417.19
8.0.90.0000.00817.08
8.0.80.0100.00717.22
8.0.70.0000.00817.04
8.0.60.0050.00317.08
8.0.50.0000.00817.13
8.0.30.0120.01017.29
8.0.20.0100.00917.40
8.0.10.0040.00417.14
8.0.00.0090.00917.18
7.4.330.0000.00515.17
7.4.320.0030.00316.77
7.4.300.0060.00016.79
7.4.290.0030.00316.84
7.4.280.0030.00516.87
7.4.270.0060.00316.89
7.4.260.0080.00016.79
7.4.250.0000.00816.80
7.4.240.0040.00416.83
7.4.230.0000.00716.58
7.4.220.0090.00916.95
7.4.210.0050.01216.84
7.4.200.0000.00816.91
7.4.190.0030.00316.66
7.4.160.0100.00716.61
7.4.150.0000.01917.40
7.4.140.0130.00517.86
7.4.130.0120.00816.65
7.4.120.0070.01316.79
7.4.110.0160.00616.79
7.4.100.0150.00816.82
7.4.90.0120.00916.88
7.4.80.0070.01119.39
7.4.70.0180.00716.86
7.4.60.0060.01116.81
7.4.50.0060.00316.73
7.4.40.0080.00522.77
7.4.30.0130.00616.65
7.4.00.0050.01315.08
7.3.330.0030.00313.55
7.3.320.0050.00013.48
7.3.310.0040.00416.61
7.3.300.0000.00716.59
7.3.290.0030.01116.58
7.3.280.0090.00816.52
7.3.270.0090.01317.40
7.3.260.0140.00516.70
7.3.250.0090.00916.63
7.3.240.0090.00916.88
7.3.230.0130.00916.83
7.3.210.0090.01316.86
7.3.200.0100.00719.39
7.3.190.0030.01516.56
7.3.180.0110.00516.65
7.3.170.0120.00616.58
7.3.160.0080.00816.86
7.3.120.0080.00914.96
7.3.110.0060.01215.07
7.3.100.0100.00615.25
7.3.90.0040.00815.05
7.3.80.0090.00314.91
7.3.70.0040.00714.96
7.3.60.0090.00615.19
7.3.50.0030.01414.99
7.3.40.0040.01114.85
7.3.30.0030.01015.12
7.3.20.0060.01016.70
7.3.10.0100.00717.01
7.3.00.0030.01316.86
7.2.330.0120.00616.90
7.2.320.0120.00616.74
7.2.310.0040.01717.09
7.2.300.0110.00616.94
7.2.290.0100.00617.02
7.2.250.0100.01015.20
7.2.240.0000.01315.43
7.2.230.0040.01115.32
7.2.220.0080.00415.46
7.2.210.0030.01015.41
7.2.200.0120.00315.52
7.2.190.0070.01015.13
7.2.180.0070.01014.94
7.2.170.0090.00315.50
7.2.60.0040.01117.28
7.1.330.0000.01416.03
7.1.320.0030.00616.02
7.1.310.0080.00616.23
7.1.300.0040.00915.76
7.1.290.0130.00015.90
7.1.280.0040.00816.10
7.1.270.0060.01216.12
7.1.260.0070.00716.24
7.1.200.0080.00815.75
7.1.70.0060.00617.57
7.1.60.0090.01219.82
7.1.50.0040.01817.22
7.1.00.0100.08722.55
7.0.200.0000.01016.84
7.0.140.0130.06322.22
7.0.60.0030.04020.14
7.0.50.0100.06717.85
7.0.40.0070.05320.13
7.0.30.0330.07320.36
7.0.20.0300.05020.26
7.0.10.0000.05720.11
7.0.00.0270.07020.21
5.6.280.0030.07321.12
5.6.210.0100.04320.68
5.6.200.0000.07718.29
5.6.190.0070.05720.60
5.6.180.0130.04720.41
5.6.170.0370.04020.62
5.6.160.0030.05020.39
5.6.150.0030.07018.29
5.6.140.0000.08718.18
5.6.130.0100.06318.28
5.6.120.0070.08320.98
5.6.110.0070.08721.01
5.6.100.0130.03021.11
5.6.90.0100.07320.98
5.6.80.0030.05020.55
5.5.350.3230.04320.31
5.5.340.0170.07018.01
5.5.330.0100.07020.28
5.5.320.0230.04320.30
5.5.310.0330.05020.38
5.5.300.0030.06717.95
5.5.290.0130.08017.96
5.5.280.0030.04020.79
5.5.270.0100.08020.81
5.5.260.0030.04720.75
5.5.250.0030.04020.51
5.5.240.0100.07020.17
5.4.450.0170.07719.47
5.4.440.0270.07319.49
5.4.430.0330.06719.18
5.4.420.0270.03019.39
5.4.410.0300.07019.51
5.4.400.0200.06719.08
5.4.390.0270.04718.95
5.4.380.0300.06319.16
5.4.370.0270.06019.09
5.4.360.0230.05319.24
5.4.350.0270.06019.24
5.4.340.0200.05319.31
5.4.320.0270.07319.13
5.4.310.0370.03319.16
5.4.300.0200.06019.00
5.4.290.0230.06019.31
5.4.280.0300.04719.16
5.4.270.0200.06319.22
5.4.260.0200.05319.14
5.4.250.0270.06719.11
5.4.240.0130.06018.98
5.4.230.0200.07319.03
5.4.220.0230.07019.21
5.4.210.0130.04718.84
5.4.200.0330.07018.84
5.4.190.0130.05319.07
5.4.180.0130.07318.93
5.4.170.0200.08319.05
5.4.160.0170.04319.29
5.4.150.0170.03718.85
5.4.140.0130.06716.44
5.4.130.0200.06716.56
5.4.120.0270.05016.50
5.4.110.0200.05016.59
5.4.100.0270.04716.61
5.4.90.0270.04316.29
5.4.80.0200.05316.62
5.4.70.0230.06016.62
5.4.60.0230.04716.38
5.4.50.0230.04316.56
5.4.40.0270.06316.25
5.4.30.0170.03316.21
5.4.20.0130.03716.54
5.4.10.0100.04016.53
5.4.00.0170.04715.96
5.3.290.0170.05314.91
5.3.280.0170.05014.53
5.3.270.0130.08014.60
5.3.260.0230.04714.71
5.3.250.0270.06714.52
5.3.240.0200.03714.63
5.3.230.0130.05314.78
5.3.220.0270.04714.80
5.3.210.0300.05714.59
5.3.200.0230.04014.50
5.3.190.0300.07014.74
5.3.180.0200.07314.59
5.3.170.0230.05714.56
5.3.160.0270.05714.55
5.3.150.0300.06314.56
5.3.140.0270.04714.54
5.3.130.0270.02714.54
5.3.120.0170.03714.57
5.3.110.0170.04314.54
5.3.100.0170.04014.21
5.3.90.0270.03014.19
5.3.80.0100.04314.04
5.3.70.0070.04314.04
5.3.60.0100.03713.93
5.3.50.0200.04014.06
5.3.40.0170.03313.98
5.3.30.0170.03314.02
5.3.20.0200.03013.94
5.3.10.0230.03013.61
5.3.00.0170.03313.66
5.2.170.0170.06012.21
5.2.160.0030.03712.21
5.2.150.0100.04012.21
5.2.140.0130.02712.21
5.2.130.0100.03012.21
5.2.120.0130.02712.21
5.2.110.0100.03012.21
5.2.100.0130.02712.21
5.2.90.0170.03012.21
5.2.80.0170.02712.21
5.2.70.0130.03712.21
5.2.60.0100.03012.21
5.2.50.0100.03012.21
5.2.40.0100.02712.21
5.2.30.0100.02712.21
5.2.20.0170.02012.21
5.2.10.0100.03012.21
5.2.00.0200.02712.21
5.1.60.0130.02312.21
5.1.50.0100.02312.21
5.1.40.0130.02312.21
5.1.30.0130.02012.21
5.1.20.0070.02712.21
5.1.10.0030.03012.21
5.1.00.0100.02312.21
5.0.50.0030.02012.21
5.0.40.0070.02012.21
5.0.30.0070.04012.21
5.0.20.0070.02012.21
5.0.10.0070.02312.21
5.0.00.0030.04312.21
4.4.90.0030.01712.21
4.4.80.0070.01312.21
4.4.70.0070.01312.21
4.4.60.0100.01012.21
4.4.50.0100.01012.21
4.4.40.0070.02312.21
4.4.30.0070.01712.21
4.4.20.0070.01312.21
4.4.10.0070.01712.21
4.4.00.0030.02312.21
4.3.110.0070.01312.21
4.3.100.0030.02012.21
4.3.90.0100.01312.21
4.3.80.0100.03312.21
4.3.70.0070.01712.21
4.3.60.0100.01012.21
4.3.50.0070.01312.21
4.3.40.0000.02712.21
4.3.30.0000.01712.21
4.3.20.0000.02312.21
4.3.10.0000.02012.21
4.3.00.0030.03312.21

preferences:
43.99 ms | 401 KiB | 5 Q