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 'getURLs return' . $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_number => $linee) { echo "\n"; $htmlfiche = $reader->getHTML($linee); 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.60.0070.01018.49
8.3.50.0110.00522.24
8.3.40.0060.01019.27
8.3.30.0070.00719.13
8.3.20.0080.00020.34
8.3.10.0050.00322.09
8.3.00.0050.00322.37
8.2.180.0060.00917.00
8.2.170.0140.00322.96
8.2.160.0120.00319.10
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0080.00019.61
8.2.110.0030.00622.29
8.2.100.0040.00819.88
8.2.90.0000.00819.34
8.2.80.0040.00417.97
8.2.70.0050.00517.88
8.2.60.0050.00318.04
8.2.50.0000.00918.07
8.2.40.0040.00418.28
8.2.30.0050.00218.20
8.2.20.0050.00217.91
8.2.10.0000.00817.94
8.2.00.0030.00517.78
8.1.280.0090.00925.92
8.1.270.0050.00522.31
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00823.71
8.1.230.0070.00419.10
8.1.220.0000.00917.74
8.1.210.0080.00018.77
8.1.200.0050.00517.60
8.1.190.0000.00817.65
8.1.180.0030.00618.86
8.1.170.0050.00318.89
8.1.160.0030.00622.14
8.1.150.0040.00418.88
8.1.140.0070.00017.67
8.1.130.0000.00717.93
8.1.120.0040.00417.68
8.1.110.0000.00817.64
8.1.100.0000.00717.58
8.1.90.0030.00517.65
8.1.80.0040.00417.66
8.1.70.0000.00717.62
8.1.60.0030.00617.77
8.1.50.0060.00317.71
8.1.40.0030.00517.67
8.1.30.0020.00517.68
8.1.20.0040.00417.73
8.1.10.0000.00817.75
8.1.00.0000.00817.63
8.0.300.0020.00518.77
8.0.290.0040.00417.05
8.0.280.0070.00018.51
8.0.270.0030.00317.31
8.0.260.0030.00317.08
8.0.250.0000.00717.18
8.0.240.0000.00717.16
8.0.230.0070.00017.17
8.0.220.0030.00317.16
8.0.210.0030.00317.13
8.0.200.0030.00317.09
8.0.190.0020.00517.21
8.0.180.0040.00417.23
8.0.170.0030.00517.14
8.0.160.0000.00817.21
8.0.150.0040.00417.11
8.0.140.0080.00017.07
8.0.130.0000.00613.59
8.0.120.0000.00817.04
8.0.110.0030.00617.17
8.0.100.0030.00517.00
8.0.90.0000.00717.06
8.0.80.0060.00917.04
8.0.70.0000.00817.13
8.0.60.0000.00817.20
8.0.50.0040.00417.04
8.0.30.0120.00717.34
8.0.20.0120.01017.45
8.0.10.0000.00717.12
8.0.00.0090.01216.95
7.4.330.0030.00315.14
7.4.320.0000.00716.76
7.4.300.0030.00316.89
7.4.290.0030.00316.76
7.4.280.0040.00416.87
7.4.270.0070.00016.68
7.4.260.0000.01016.69
7.4.250.0000.00716.66
7.4.240.0040.00416.80
7.4.230.0040.00416.59
7.4.220.0120.00916.89
7.4.210.0060.00916.81
7.4.200.0000.00816.59
7.4.190.0030.00316.79
7.4.160.0060.00916.64
7.4.150.0120.00617.40
7.4.140.0050.01417.86
7.4.130.0060.01316.77
7.4.120.0090.00916.81
7.4.110.0090.00916.77
7.4.100.0030.01716.77
7.4.90.0090.00916.74
7.4.80.0030.01419.39
7.4.70.0140.00616.64
7.4.60.0040.01516.85
7.4.50.0000.00416.49
7.4.40.0060.01022.77
7.4.30.0080.00816.88
7.4.00.0060.00915.19
7.3.330.0000.00613.62
7.3.320.0000.00613.55
7.3.310.0030.00416.59
7.3.300.0070.00016.61
7.3.290.0100.00316.56
7.3.280.0100.00816.54
7.3.270.0140.00317.40
7.3.260.0030.01616.58
7.3.250.0150.00416.79
7.3.240.0140.00316.71
7.3.230.0100.01416.76
7.3.210.0130.00316.58
7.3.200.0080.00819.39
7.3.190.0070.01016.52
7.3.180.0100.00716.59
7.3.170.0070.01016.53
7.3.160.0070.01116.91
7.3.120.0000.01414.92
7.3.00.0060.00616.86
7.2.330.0100.00917.04
7.2.320.0080.01016.98
7.2.310.0120.00616.71
7.2.300.0060.01216.91
7.2.290.0070.01416.80
7.2.130.0080.00417.25
7.2.120.0040.00817.25
7.2.110.0080.00316.98
7.2.100.0110.00017.22
7.2.90.0060.00617.24
7.2.80.0060.00617.12
7.2.70.0030.01017.12
7.2.60.0030.01016.91
7.2.50.0040.01417.06
7.2.40.0030.00616.97
7.2.30.0130.00317.09
7.2.20.0060.00617.14
7.2.10.0030.00717.13
7.2.00.0060.00617.14
7.1.250.0040.00715.63
7.1.240.0070.00315.84
7.1.230.0030.01216.09
7.1.220.0000.01016.09
7.1.210.0070.00715.92
7.1.200.0100.00515.74
7.1.190.0090.00615.86
7.1.180.0030.01015.91
7.1.170.0060.00915.74
7.1.160.0040.01116.08
7.1.150.0060.00615.81
7.1.140.0140.00316.03
7.1.130.0080.00315.98
7.1.120.0060.00615.96
7.1.110.0110.00715.84
7.1.100.0110.00016.09
7.1.90.0050.00515.78
7.1.80.0040.00715.96
7.1.70.0060.00316.70
7.1.60.0010.01116.64
7.1.50.0020.01516.70
7.1.40.0030.00915.92
7.1.30.0000.00815.88
7.1.20.0100.00315.77
7.1.10.0070.00715.83
7.1.00.0030.04319.14
7.0.330.0030.01015.45
7.0.320.0000.01015.41
7.0.310.0060.00615.66
7.0.300.0120.00015.41
7.0.290.0000.01015.58
7.0.280.0080.00315.57
7.0.270.0070.00315.62
7.0.260.0000.00815.63
7.0.250.0040.00715.48
7.0.240.0000.01015.63
7.0.230.0090.00615.67
7.0.220.0090.00015.82
7.0.210.0030.00715.41
7.0.200.0060.00716.31
7.0.190.0030.00715.43
7.0.180.0120.00615.63
7.0.170.0030.00715.64
7.0.160.0090.00315.77
7.0.150.0000.00815.39
7.0.140.0080.04018.81
7.0.130.0160.00015.62
7.0.120.0070.00715.27
7.0.110.0140.04517.85
7.0.100.0050.05217.65
7.0.90.0130.03617.80
7.0.80.0110.04617.80
7.0.70.0100.04317.70
7.0.60.0130.03817.82
7.0.50.0120.04517.76
7.0.40.0110.03716.78
7.0.30.0050.04716.81
7.0.20.0030.04516.59
7.0.10.0030.04216.63
7.0.00.0100.04216.73
5.6.380.0030.01014.80
5.6.370.0080.00314.52
5.6.360.0030.00814.35
5.6.350.0030.00714.32
5.6.340.0090.00614.58
5.6.330.0030.00714.07
5.6.320.0070.00714.50
5.6.310.0030.01014.54
5.6.300.0060.00614.54
5.6.290.0040.00814.45
5.6.280.0030.00914.35
5.6.270.0070.00714.30
5.6.260.0030.04917.56
5.6.250.0130.03617.57
5.6.240.0100.03917.61
5.6.230.0030.04817.62
5.6.220.0080.03317.44
5.6.210.0080.04017.65
5.6.200.0080.04417.67
5.6.190.0030.04617.49
5.6.180.0070.04417.51
5.6.170.0080.04217.47
5.6.160.0030.04317.72
5.6.150.0050.04217.45
5.6.140.0150.03917.46
5.6.130.0020.05217.59
5.6.120.0120.03817.57
5.6.110.0020.04917.56
5.6.100.0080.04217.53
5.6.90.0100.03817.58
5.6.80.0110.04217.27
5.6.70.0080.04317.21
5.6.60.0080.03517.21
5.6.50.0050.03717.32
5.6.40.0070.04217.32
5.6.30.0070.04217.13
5.6.20.0070.04417.09
5.6.10.0030.04317.27
5.6.00.0070.02617.23
5.5.380.0080.04214.47
5.5.370.0080.03614.49
5.5.360.0090.03714.50
5.5.350.0080.03614.42
5.5.340.0050.04314.70
5.5.330.0030.04014.64
5.5.320.0060.04114.77
5.5.310.0030.04614.82
5.5.300.0070.03114.61
5.5.290.0080.03714.69
5.5.280.0080.04314.62
5.5.270.0100.04214.85
5.5.260.0080.04214.71
5.5.250.0020.04814.44
5.5.240.0120.03314.36
5.5.230.0050.04414.23
5.5.220.0070.03814.30
5.5.210.0070.03814.40
5.5.200.0070.03614.43
5.5.190.0100.03814.36
5.5.180.0050.03714.34
5.5.170.0070.00310.87
5.5.160.0030.04514.30
5.5.150.0070.02414.38
5.5.140.0020.02514.34
5.5.130.0050.02214.11
5.5.120.0030.03214.31
5.5.110.0050.02014.38
5.5.100.0100.01714.21
5.5.90.0030.02214.15
5.5.80.0040.02714.31
5.5.70.0070.01914.32
5.5.60.0030.02614.05
5.5.50.0030.02714.40
5.5.40.0090.03214.17
5.5.30.0080.03814.26
5.5.20.0080.02314.12
5.5.10.0030.02214.12
5.5.00.0030.02414.28
5.4.450.0030.04715.09
5.4.440.0100.03515.06
5.4.430.0070.02815.40
5.4.420.0050.04515.38
5.4.410.0070.05215.32
5.4.400.0010.04315.15
5.4.390.0080.04014.98
5.4.380.0090.03815.09
5.4.370.0070.03715.19
5.4.360.0080.03615.14
5.4.350.0110.03315.18
5.4.340.0070.04015.12
5.4.330.0080.00011.19
5.4.320.0070.03715.18
5.4.310.0040.02415.25
5.4.300.0050.02115.10
5.4.290.0050.02215.08
5.4.280.0080.02115.11
5.4.270.0070.02215.00
5.4.260.0070.01715.32
5.4.250.0070.02815.02
5.4.240.0020.02715.21
5.4.230.0030.02515.15
5.4.220.0080.02315.00
5.4.210.0070.04215.26
5.4.200.0020.03315.07
5.4.190.0030.02015.21
5.4.180.0070.01815.05
5.4.170.0020.02415.19
5.4.160.0030.02015.05
5.4.150.0040.02015.18
5.4.140.0050.01913.91
5.4.130.0050.01813.85
5.4.120.0000.02313.92
5.4.110.0040.02513.88
5.4.100.0020.02013.82
5.4.90.0030.02213.84
5.4.80.0050.01913.93
5.4.70.0040.01813.81
5.4.60.0030.02313.80
5.4.50.0030.02113.76
5.4.40.0030.01813.85
5.4.30.0030.02113.80
5.4.20.0060.02513.71
5.4.10.0020.02013.64
5.4.00.0030.03613.53
5.3.290.0080.03812.57
5.3.280.0080.03812.64
5.3.270.0050.02012.75
5.3.260.0020.02312.74
5.3.250.0080.01812.67
5.3.240.0030.02212.73
5.3.230.0070.01812.57
5.3.220.0030.01612.60
5.3.210.0020.02312.72
5.3.200.0030.02012.63
5.3.190.0050.02412.70
5.3.180.0000.02512.77
5.3.170.0050.02012.70
5.3.160.0060.02012.76
5.3.150.0050.01712.80
5.3.140.0030.02212.71
5.3.130.0030.02412.66
5.3.120.0060.02212.66
5.3.110.0080.01812.67
5.3.100.0040.02212.39
5.3.90.0060.01512.48
5.3.80.0030.01912.20
5.3.70.0050.03612.31
5.3.60.0050.03812.36
5.3.50.0050.03912.33
5.3.40.0040.04112.42
5.3.30.0040.03912.31
5.3.20.0080.03512.22
5.3.10.0090.02312.15
5.3.00.0070.03812.12
5.2.170.0010.01810.77
5.2.160.0030.03010.79
5.2.150.0040.03710.64
5.2.140.0030.03210.74
5.2.130.0000.03510.76
5.2.120.0020.03410.76
5.2.110.0000.03610.77
5.2.100.0110.01310.77
5.2.90.0020.02910.76
5.2.80.0110.01810.76
5.2.70.0020.03710.72
5.2.60.0040.02010.75
5.2.50.0030.03510.60
5.2.40.0100.03010.67
5.2.30.0070.02810.75
5.2.20.0050.02710.68
5.2.10.0080.03010.56
5.2.00.0070.02710.51
5.1.60.0010.01810.23
5.1.50.0050.02610.30
5.1.40.0020.02810.35
5.1.30.0050.02810.38
5.1.20.0080.03010.37
5.1.10.0070.02510.35
5.1.00.0050.02710.25
5.0.50.0050.02210.16
5.0.40.0050.02310.16
5.0.30.0040.01810.16
5.0.20.0070.02010.16
5.0.10.0070.01810.16
5.0.00.0030.02610.16
4.4.90.0030.01810.16
4.4.80.0060.01510.16
4.4.70.0030.01310.16
4.4.60.0030.01510.16
4.4.50.0050.01610.16
4.4.40.0000.03010.16
4.4.30.0050.01210.16
4.4.20.0020.02110.16
4.4.10.0010.02110.16
4.4.00.0020.03010.16
4.3.110.0030.01710.16
4.3.100.0060.01110.16
4.3.90.0020.01910.16
4.3.80.0000.02610.16
4.3.70.0020.02010.16
4.3.60.0030.01910.16
4.3.50.0050.01510.16
4.3.40.0060.01310.16
4.3.30.0050.01510.16
4.3.20.0020.02010.16
4.3.10.0050.01610.16
4.3.00.0000.01910.16

preferences:
62.03 ms | 400 KiB | 5 Q