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($hmtl) { 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) { 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 => $line2) { echo "\n"; $htmlfiche = $reader->getHTML($line2); 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.0090.00618.80
8.3.50.0030.01622.18
8.3.40.0090.00619.18
8.3.30.0060.00919.22
8.3.20.0000.00820.10
8.3.10.0080.00021.95
8.3.00.0050.00322.44
8.2.180.0080.00817.00
8.2.170.0150.00022.96
8.2.160.0120.00919.21
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0180.00026.16
8.2.120.0060.00319.68
8.2.110.0060.00322.21
8.2.100.0130.00019.82
8.2.90.0040.00419.17
8.2.80.0050.00318.05
8.2.70.0090.00017.88
8.2.60.0030.00618.03
8.2.50.0060.00318.07
8.2.40.0030.00618.28
8.2.30.0070.00018.20
8.2.20.0000.00817.93
8.2.10.0040.00417.93
8.2.00.0040.00417.91
8.1.280.0120.00325.92
8.1.270.0060.00322.09
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.67
8.1.230.0090.00319.05
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0090.00017.60
8.1.190.0000.00817.75
8.1.180.0080.00018.87
8.1.170.0000.00818.95
8.1.160.0040.00422.14
8.1.150.0040.00418.83
8.1.140.0040.00417.63
8.1.130.0070.00017.89
8.1.120.0050.00217.48
8.1.110.0000.00917.54
8.1.100.0000.00717.52
8.1.90.0000.00717.54
8.1.80.0050.00317.63
8.1.70.0030.00617.59
8.1.60.0040.00417.82
8.1.50.0030.00617.68
8.1.40.0040.00417.64
8.1.30.0080.00017.71
8.1.20.0050.00317.80
8.1.10.0060.00317.77
8.1.00.0000.00817.58
8.0.300.0000.00818.77
8.0.290.0090.00017.16
8.0.280.0000.00718.55
8.0.270.0040.00417.19
8.0.260.0040.00417.07
8.0.250.0000.00717.16
8.0.240.0000.00717.26
8.0.230.0020.00517.16
8.0.220.0040.00417.07
8.0.210.0070.00017.07
8.0.200.0050.00217.18
8.0.190.0080.00017.19
8.0.180.0000.00717.05
8.0.170.0050.00317.17
8.0.160.0030.00517.11
8.0.150.0000.00816.99
8.0.140.0060.00317.02
8.0.130.0000.00613.45
8.0.120.0060.00317.01
8.0.110.0030.00617.03
8.0.100.0060.00317.25
8.0.90.0000.00817.00
8.0.80.0070.00917.07
8.0.70.0000.00817.08
8.0.60.0080.00016.96
8.0.50.0040.00417.03
8.0.30.0040.01517.29
8.0.20.0090.00917.40
8.0.10.0080.00017.27
8.0.00.0110.00817.13
7.4.330.0050.00015.11
7.4.320.0070.00016.77
7.4.300.0000.00616.75
7.4.290.0000.00716.69
7.4.280.0050.00216.76
7.4.270.0000.00716.76
7.4.260.0040.00416.65
7.4.250.0060.00316.70
7.4.240.0020.00516.82
7.4.230.0050.00316.87
7.4.220.0100.00716.81
7.4.210.0080.01316.79
7.4.200.0000.00816.65
7.4.190.0000.00716.95
7.4.160.0160.00616.78
7.4.150.0110.00917.40
7.4.140.0150.00517.86
7.4.130.0100.01016.70
7.4.120.0130.00916.77
7.4.110.0140.00616.97
7.4.100.0090.01016.94
7.4.90.0090.01516.79
7.4.80.0150.00919.39
7.4.70.0130.01016.61
7.4.60.0140.00816.87
7.4.50.0040.00416.55
7.4.40.0040.01222.77
7.4.30.0120.01216.65
7.4.00.0080.00815.15
7.3.330.0030.00313.38
7.3.320.0050.00013.60
7.3.310.0050.00216.63
7.3.300.0000.00816.56
7.3.290.0070.00716.51
7.3.280.0080.00916.53
7.3.270.0110.00717.40
7.3.260.0110.01416.77
7.3.250.0180.00716.63
7.3.240.0170.00016.86
7.3.230.0040.01716.85
7.3.210.0150.00316.77
7.3.200.0170.00019.39
7.3.190.0120.00616.55
7.3.180.0140.00316.63
7.3.170.0060.01616.72
7.3.160.0100.00616.62
7.3.120.0110.00515.02
7.3.110.0070.01015.26
7.3.100.0090.00615.05
7.3.90.0060.00615.04
7.3.80.0070.00715.01
7.3.70.0070.00714.85
7.3.60.0000.01415.14
7.3.50.0070.00714.93
7.3.40.0040.00415.25
7.3.30.0150.00015.07
7.3.20.0070.01016.96
7.3.10.0170.00616.95
7.3.00.0090.01116.79
7.2.330.0060.01217.05
7.2.320.0130.00916.95
7.2.310.0090.00916.94
7.2.300.0160.01116.88
7.2.290.0090.01216.95
7.2.250.0070.01115.55
7.2.240.0070.01415.53
7.2.230.0070.01015.54
7.2.220.0000.01815.50
7.2.210.0040.01515.09
7.2.200.0090.00615.34
7.2.190.0090.00615.30
7.2.180.0030.01315.56
7.2.170.0030.00715.41
7.2.130.0110.01817.29
7.2.120.0220.01117.17
7.2.110.0250.00817.25
7.2.100.0220.00817.21
7.2.90.0230.01317.36
7.2.80.0260.00717.23
7.2.70.0250.01117.20
7.2.60.0250.00817.13
7.2.50.0250.00817.14
7.2.40.0210.01017.27
7.2.30.0180.01217.00
7.2.20.0160.01117.26
7.2.10.0200.01316.90
7.2.00.0090.01018.41
7.1.330.0040.01116.03
7.1.320.0080.00816.24
7.1.310.0030.00716.02
7.1.300.0090.00615.81
7.1.290.0030.00615.80
7.1.280.0030.01015.97
7.1.270.0070.00716.14
7.1.260.0030.00715.98
7.1.250.0220.01015.83
7.1.240.0170.01215.75
7.1.230.0140.00616.02
7.1.220.0170.01015.76
7.1.210.0230.00915.91
7.1.200.0250.00816.16
7.1.190.0240.00816.18
7.1.180.0090.01616.11
7.1.170.0240.00016.16
7.1.160.0160.00816.14
7.1.150.0180.00915.96
7.1.140.0170.01415.97
7.1.130.0130.01516.00
7.1.120.0130.01316.11
7.1.110.0220.00615.96
7.1.100.0100.01417.18
7.1.90.0180.00716.22
7.1.80.0170.00816.03
7.1.70.0100.00516.76
7.1.60.0150.01317.87
7.1.50.0170.00416.50
7.1.40.0120.00615.91
7.1.30.0160.01115.83
7.1.20.0120.01215.71
7.1.10.0130.00715.98
7.1.00.0050.04419.23
7.0.330.0220.00315.72
7.0.320.0120.01215.19
7.0.310.0180.00715.48
7.0.300.0230.00315.60
7.0.290.0180.00715.57
7.0.280.0100.01415.50
7.0.270.0200.00615.54
7.0.260.0170.00615.61
7.0.250.0160.01015.82
7.0.240.0140.00015.68
7.0.230.0050.01415.62
7.0.220.0150.00615.51
7.0.210.0140.00715.37
7.0.200.0070.00916.11
7.0.190.0160.00315.67
7.0.180.0120.01215.50
7.0.170.0060.01215.28
7.0.160.0090.01215.67
7.0.150.0070.01015.68
7.0.140.0120.03718.64
7.0.130.0130.00415.57
7.0.120.0180.00415.41
7.0.110.0090.00915.48
7.0.100.0080.02617.61
7.0.90.0040.02717.67
7.0.80.0070.02917.63
7.0.70.0100.02317.88
7.0.60.0120.02217.80
7.0.50.0100.02317.77
7.0.40.0070.01916.64
7.0.30.0040.02716.76
7.0.20.0070.03416.68
7.0.10.0070.02316.83
7.0.00.0080.02216.82
5.6.380.0160.00814.45
5.6.370.0120.00614.53
5.6.360.0070.00714.36
5.6.350.0110.01114.39
5.6.340.0000.01714.52
5.6.330.0150.00614.21
5.6.320.0070.01514.27
5.6.310.0050.01514.56
5.6.300.0080.00714.25
5.6.290.0060.01014.59
5.6.280.0080.03817.79
5.6.270.0120.00614.49
5.6.260.0090.00714.40
5.6.250.0080.02217.52
5.6.240.0050.02617.51
5.6.230.0070.02317.42
5.6.220.0010.03317.29
5.6.210.0120.01917.54
5.6.200.0050.02717.61
5.6.190.0050.02517.59
5.6.180.0070.03117.76
5.6.170.0060.02017.62
5.6.160.0070.03417.56
5.6.150.0120.04217.53
5.6.140.0070.02717.63
5.6.130.0060.05017.68
5.6.120.0050.05017.74
5.6.110.0070.04417.64
5.6.100.0080.04617.69
5.6.90.0100.03417.70
5.6.80.0120.04217.61
5.6.70.0120.03117.38
5.6.60.0130.04017.31
5.6.50.0090.04417.45
5.6.40.0080.04117.55
5.6.30.0110.04417.26
5.6.20.0050.03017.31
5.6.10.0110.01917.37
5.6.00.0060.04617.31
5.5.380.0020.03115.63
5.5.370.0020.02615.83
5.5.360.0030.02515.91
5.5.350.0050.02415.63
5.5.340.0110.02015.99
5.5.330.0080.02015.87
5.5.320.0050.02315.79
5.5.310.0020.02716.05
5.5.300.0070.02815.86
5.5.290.0080.04016.10
5.5.280.0100.04016.14
5.5.270.0040.03916.17
5.5.260.0080.04216.04
5.5.250.0090.04316.03
5.5.240.0040.03715.66
5.5.230.0070.02715.84
5.5.220.0090.03315.81
5.5.210.0040.03115.77
5.5.200.0080.04215.75
5.5.190.0130.03715.63
5.5.180.0090.02415.66
5.5.170.0060.00611.07
5.5.160.0060.02615.71
5.5.150.0090.04015.68
5.5.140.0040.03615.64
5.5.130.0070.04215.87
5.5.120.0090.04115.63
5.5.110.0090.02515.83
5.5.100.0100.03515.51
5.5.90.0120.03615.52
5.5.80.0050.04215.59
5.5.70.0070.03615.54
5.5.60.0040.04615.49
5.5.50.0140.03715.56
5.5.40.0050.02815.56
5.5.30.0080.03515.70
5.5.20.0100.03915.58
5.5.10.0100.03515.60
5.5.00.0020.02615.41
5.4.450.0120.02515.37
5.4.440.0070.04615.31
5.4.430.0120.01815.30
5.4.420.0020.04715.34
5.4.410.0050.03715.19
5.4.400.0090.03615.09
5.4.390.0060.03615.08
5.4.380.0050.02515.13
5.4.370.0030.04715.02
5.4.360.0100.02215.25
5.4.350.0040.04015.23
5.4.340.0070.03515.13
5.4.330.0000.01411.42
5.4.320.0000.04415.20
5.4.310.0070.03715.28
5.4.300.0020.02715.16
5.4.290.0090.03615.19
5.4.280.0060.02415.29
5.4.270.0070.02015.09
5.4.260.0070.04015.08
5.4.250.0030.03614.95
5.4.240.0080.03815.05
5.4.230.0100.03715.08
5.4.220.0060.02815.14
5.4.210.0070.03615.13
5.4.200.0050.03915.18
5.4.190.0110.03414.98
5.4.180.0050.02715.05
5.4.170.0050.03215.08
5.4.160.0050.04315.21
5.4.150.0110.02815.16
5.4.140.0090.02213.89
5.4.130.0050.03913.68
5.4.120.0030.03113.75
5.4.110.0050.03013.86
5.4.100.0050.03013.73
5.4.90.0100.03313.86
5.4.80.0090.03313.89
5.4.70.0060.02313.80
5.4.60.0070.03513.91
5.4.50.0080.03813.78
5.4.40.0080.03513.97
5.4.30.0030.03213.73
5.4.20.0070.02513.90
5.4.10.0060.02513.69
5.4.00.0070.03713.55
5.3.290.0080.03512.75
5.3.280.0020.04312.69
5.3.270.0070.02412.64
5.3.260.0030.04312.71
5.3.250.0050.04412.68
5.3.240.0050.03812.67
5.3.230.0050.02712.60
5.3.220.0080.03812.69
5.3.210.0080.03512.62
5.3.200.0030.02312.55
5.3.190.0070.04012.52
5.3.180.0080.03712.74
5.3.170.0080.03212.72
5.3.160.0080.03812.77
5.3.150.0020.04512.75
5.3.140.0050.03712.82
5.3.130.0030.04412.53
5.3.120.0100.03712.60
5.3.110.0030.03612.52
5.3.100.0030.02712.36
5.3.90.0070.03312.40
5.3.80.0070.04012.37
5.3.70.0020.02812.36
5.3.60.0030.02312.33
5.3.50.0080.03312.27
5.3.40.0030.02212.32
5.3.30.0060.03612.11
5.3.20.0080.03012.15
5.3.10.0080.03512.04
5.3.00.0080.02012.02
5.2.170.0020.03711.13
5.2.160.0070.01811.11
5.2.150.0050.01811.15
5.2.140.0040.03311.03
5.2.130.0020.02511.09
5.2.120.0030.03611.07
5.2.110.0030.02111.16
5.2.100.0060.02111.11
5.2.90.0050.01911.10
5.2.80.0050.02011.05
5.2.70.0070.02911.09
5.2.60.0070.02511.04
5.2.50.0050.01811.06
5.2.40.0060.02610.99
5.2.30.0050.03011.06
5.2.20.0040.02210.91
5.2.10.0010.02110.96
5.2.00.0060.02910.90
5.1.60.0040.02710.49
5.1.50.0050.02810.54
5.1.40.0050.02810.65
5.1.30.0050.02310.63
5.1.20.0050.02910.65
5.1.10.0050.02810.67
5.1.00.0050.01510.49
5.0.50.0030.02510.49
5.0.40.0080.01810.49
5.0.30.0050.03310.49
5.0.20.0040.02410.49
5.0.10.0030.02410.49
5.0.00.0030.02910.49
4.4.90.0000.01810.49
4.4.80.0020.01810.49
4.4.70.0020.02010.49
4.4.60.0050.01810.49
4.4.50.0030.01810.49
4.4.40.0040.03210.49
4.4.30.0010.02010.49
4.4.20.0020.02010.49
4.4.10.0030.00810.49
4.4.00.0020.01810.49
4.3.110.0050.01810.49
4.3.100.0030.01810.49
4.3.90.0030.01310.49
4.3.80.0010.01610.49
4.3.70.0020.02010.49
4.3.60.0020.01010.49
4.3.50.0030.01810.49
4.3.40.0020.02810.49
4.3.30.0000.01310.49
4.3.20.0020.00810.49
4.3.10.0020.01810.49
4.3.00.0030.00810.49

preferences:
38.43 ms | 401 KiB | 5 Q