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 'AdsListExtractor.getURLs return' . $url_fiche; echo "\n"; return array( $url_fiche,$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-bmw-x5-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.0120.00318.68
8.3.50.0060.01022.29
8.3.40.0090.00619.15
8.3.30.0090.00619.26
8.3.20.0090.00920.20
8.3.10.0040.00421.89
8.3.00.0030.00520.69
8.2.180.0100.00616.88
8.2.170.0120.00422.96
8.2.160.0090.00619.21
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0150.00626.16
8.2.120.0080.00019.86
8.2.110.0080.00322.20
8.2.100.0040.00918.16
8.2.90.0070.00218.06
8.2.80.0030.00517.97
8.2.70.0030.00617.88
8.2.60.0050.00518.05
8.2.50.0060.00318.07
8.2.40.0080.00018.22
8.2.30.0080.00018.25
8.2.20.0050.00317.85
8.2.10.0030.00618.06
8.2.00.0000.01117.97
8.1.280.0060.01325.92
8.1.270.0030.00623.90
8.1.260.0000.00826.35
8.1.250.0090.00028.09
8.1.240.0080.00322.55
8.1.230.0110.00020.97
8.1.220.0000.00817.79
8.1.210.0060.00318.89
8.1.200.0030.00617.61
8.1.190.0040.00417.55
8.1.180.0050.00318.82
8.1.170.0030.00518.92
8.1.160.0040.00422.18
8.1.150.0000.00718.73
8.1.140.0050.00217.51
8.1.130.0030.00317.76
8.1.120.0030.00617.67
8.1.110.0000.00817.56
8.1.100.0020.00517.68
8.1.90.0000.00817.66
8.1.80.0000.00717.61
8.1.70.0040.00417.52
8.1.60.0030.00617.77
8.1.50.0040.00417.71
8.1.40.0060.00317.73
8.1.30.0000.00917.64
8.1.20.0090.00017.84
8.1.10.0060.00317.83
8.1.00.0090.00017.59
8.0.300.0080.00019.96
8.0.290.0040.00417.04
8.0.280.0030.00518.36
8.0.270.0070.00017.16
8.0.260.0000.00717.11
8.0.250.0000.00717.22
8.0.240.0000.00717.26
8.0.230.0070.00017.20
8.0.220.0030.00317.04
8.0.210.0000.00717.05
8.0.200.0030.00317.24
8.0.190.0050.00317.09
8.0.180.0040.00417.05
8.0.170.0050.00417.18
8.0.160.0000.00717.18
8.0.150.0040.00417.10
8.0.140.0030.00517.12
8.0.130.0000.00713.53
8.0.120.0060.00316.97
8.0.110.0040.00417.09
8.0.100.0000.00717.05
8.0.90.0040.00417.12
8.0.80.0080.01117.07
8.0.70.0080.00017.10
8.0.60.0030.00516.94
8.0.50.0030.00517.15
8.0.30.0130.00817.33
8.0.20.0120.01017.40
8.0.10.0040.00417.21
8.0.00.0160.00717.01
7.4.330.0000.00515.03
7.4.320.0030.00316.75
7.4.300.0000.00716.86
7.4.290.0040.00416.80
7.4.280.0050.00316.64
7.4.270.0040.00416.83
7.4.260.0050.00316.75
7.4.250.0050.00316.80
7.4.240.0020.00616.83
7.4.230.0020.00516.65
7.4.220.0160.00916.80
7.4.210.0090.00716.82
7.4.200.0000.00716.95
7.4.190.0070.00016.71
7.4.160.0080.00816.68
7.4.150.0070.01117.40
7.4.140.0130.00617.86
7.4.130.0070.01316.65
7.4.120.0080.00916.76
7.4.110.0030.01616.74
7.4.100.0150.00316.68
7.4.90.0030.01516.99
7.4.80.0160.00319.39
7.4.70.0030.01716.73
7.4.60.0130.00317.01
7.4.50.0000.00416.51
7.4.40.0040.01222.77
7.4.30.0060.01216.91
7.4.00.0070.00715.20
7.3.330.0000.00513.55
7.3.320.0050.00013.44
7.3.310.0000.00716.46
7.3.300.0030.00316.63
7.3.290.0020.01616.57
7.3.280.0120.00916.59
7.3.270.0180.00717.40
7.3.260.0070.01016.81
7.3.250.0130.00516.84
7.3.240.0060.01316.61
7.3.230.0060.01216.89
7.3.210.0120.00616.78
7.3.200.0160.00316.80
7.3.190.0110.01116.81
7.3.180.0070.01016.65
7.3.170.0090.00916.55
7.3.160.0040.01216.57
7.3.120.0060.01014.97
7.2.330.0130.00816.96
7.2.320.0110.00716.95
7.2.310.0130.01016.98
7.2.300.0070.01316.72
7.2.290.0070.01017.08
7.1.70.0040.00417.40
7.1.60.0070.01719.82
7.1.50.0040.01217.20
7.1.00.0030.09022.46
7.0.200.0080.00016.90
7.0.140.0100.07022.13
7.0.60.0070.06019.97
7.0.50.0100.08017.92
7.0.40.0000.04720.15
7.0.30.0400.05720.11
7.0.20.0270.07720.26
7.0.10.0230.06720.14
7.0.00.0130.08320.09
5.6.280.0030.07321.17
5.6.210.0130.07720.68
5.6.200.0170.07018.18
5.6.190.0130.04020.52
5.6.180.3400.03720.77
5.6.170.0370.05720.50
5.6.160.0130.07020.47
5.6.150.0100.07718.25
5.6.140.0030.08018.21
5.6.130.0070.04318.27
5.6.120.0100.08021.04
5.6.110.0030.09021.04
5.6.100.0070.07721.04
5.6.90.0000.09021.02
5.6.80.0100.07320.52
5.6.70.4130.03720.41
5.5.350.0070.08720.51
5.5.340.0100.04018.02
5.5.330.0130.07720.08
5.5.320.0200.04020.34
5.5.310.0330.06020.39
5.5.300.0030.08317.96
5.5.290.0070.03717.93
5.5.280.0130.03320.82
5.5.270.0000.08320.91
5.5.260.0100.08020.81
5.5.250.0030.07320.64
5.5.240.0070.06020.18
5.4.450.0500.06319.59
5.4.440.0700.05019.58
5.4.430.0430.05319.47
5.4.420.0470.06719.40
5.4.410.0630.05019.50
5.4.400.0800.00018.83
5.4.390.0730.00018.80
5.4.380.0270.06018.59
5.4.370.0270.05018.78
5.4.360.0330.05018.84
5.4.350.0100.06018.71
5.4.340.0430.04018.76
5.4.320.0080.04412.52
5.4.310.0040.04412.52
5.4.300.0070.04512.52
5.4.290.0070.04212.51
5.4.280.0040.03712.41
5.4.270.0090.03912.41
5.4.260.0130.05018.89
5.4.250.0030.05718.93
5.4.240.0100.05018.83
5.4.230.0170.07018.72
5.4.220.0100.05318.64
5.4.210.0070.05318.73
5.4.200.0100.05718.80
5.4.190.0030.05718.98
5.4.180.0130.05018.93
5.4.170.0070.05318.74
5.4.160.0130.05018.78
5.4.150.0170.05318.91
5.4.140.0070.07716.43
5.4.130.0130.06316.34
5.4.120.0030.05016.55
5.4.110.0030.05716.52
5.4.100.0070.07316.43
5.4.90.0030.05016.55
5.4.80.0130.04316.42
5.4.70.0030.05716.38
5.4.60.0070.05016.32
5.4.50.0130.06716.45
5.4.40.0000.05316.32
5.4.30.0000.05316.41
5.4.20.0030.05316.46
5.4.10.0070.05316.36
5.4.00.0030.05015.77
5.3.290.0110.03912.80
5.3.280.0000.06014.63
5.3.270.0030.05714.53
5.3.260.0200.06314.69
5.3.250.0070.05714.71
5.3.240.0130.06314.61
5.3.230.0070.07014.52
5.3.220.0030.05714.75
5.3.210.0070.05314.49
5.3.200.0300.04014.75
5.3.190.0100.04714.67
5.3.180.0070.05014.57
5.3.170.0100.06014.59
5.3.160.0100.05714.66
5.3.150.0000.05714.76
5.3.140.0100.06014.80
5.3.130.0070.05314.57
5.3.120.0130.06314.63
5.3.110.0030.06314.39
5.3.100.0170.04714.13
5.3.90.0170.04314.12
5.3.80.0030.05313.87
5.3.70.0030.05314.13
5.3.60.0030.05714.00
5.3.50.0100.05013.87
5.3.40.0030.05714.05
5.3.30.0130.05014.01
5.3.20.0070.06713.70
5.3.10.0070.05013.75
5.3.00.0070.05713.64
5.2.170.0100.06311.07
5.2.160.0100.04311.25
5.2.150.0100.04011.00
5.2.140.0100.05011.24
5.2.130.0070.06011.13
5.2.120.0100.03711.12
5.2.110.0030.04711.11
5.2.100.0130.05311.11
5.2.90.0030.06011.21
5.2.80.0100.05711.28
5.2.70.0100.05311.10
5.2.60.0070.04311.24
5.2.50.0030.05711.03
5.2.40.0030.04011.11
5.2.30.0030.04311.09
5.2.20.0070.03711.05
5.2.10.0100.05311.05
5.2.00.0130.05010.82
5.1.60.0030.04310.26
5.1.50.0130.0279.86
5.1.40.0030.03710.05
5.1.30.0070.05010.44
5.1.20.0100.03010.55
5.1.10.0100.03310.10
5.1.00.0000.04310.14
5.0.50.0100.0238.59
5.0.40.0000.0308.54
5.0.30.0070.0578.31
5.0.20.0070.0238.38
5.0.10.0030.0278.26
5.0.00.0030.0478.39
4.4.90.0030.0276.95
4.4.80.0030.0236.95
4.4.70.0030.0206.95
4.4.60.0030.0306.95
4.4.50.0070.0206.95
4.4.40.0030.0336.95
4.4.30.0000.0236.95
4.4.20.0000.0236.95
4.4.10.0030.0206.95
4.4.00.0030.0306.95
4.3.110.0070.0176.95
4.3.100.0070.0176.95
4.3.90.0070.0176.95
4.3.80.0100.0306.95
4.3.70.0030.0306.95
4.3.60.0000.0206.95
4.3.50.0030.0206.95
4.3.40.0000.0336.95
4.3.30.0030.0206.95
4.3.20.0000.0236.95
4.3.10.0030.0276.95
4.3.00.0070.0236.97

preferences:
58.85 ms | 401 KiB | 5 Q