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-nissan-rogue-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; } 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'; } } //'http://montreal.kijiji.ca/c-ViewAd?AdId=576130148' $url_liste = "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"; $html_test = "<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>"; //$html_liste = file_get_contents($url_liste); $dal = new DAL(); foreach ($dal->getURLRecherches() as $line_num => $line) { $reader = new HTMLReader(); $liste = new AdsListExtractor($reader->getHMTL($line)); echo $line; echo "\n"; foreach ($liste->getURLs() as $line_num => $line) { $htmlfiche = $reader->getHMTL($line); $ad_info = new AdInfoExtractor($htmlfiche); echo $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.0130.00318.30
8.3.50.0190.00222.17
8.3.40.0070.00719.13
8.3.30.0040.01119.22
8.3.20.0000.00720.21
8.3.10.0080.00022.00
8.3.00.0000.00822.52
8.2.180.0080.00816.88
8.2.170.0120.00322.96
8.2.160.0110.00419.13
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.01226.16
8.2.120.0080.00019.73
8.2.110.0090.00022.20
8.2.100.0070.00420.01
8.2.90.0040.00419.29
8.2.80.0040.00418.17
8.2.70.0030.00617.88
8.2.60.0030.00618.05
8.2.50.0040.00418.07
8.2.40.0030.00518.28
8.2.30.0020.00518.09
8.2.20.0060.00317.98
8.2.10.0050.00318.05
8.2.00.0060.00317.93
8.1.280.0100.01025.92
8.1.270.0030.00623.99
8.1.260.0030.00626.35
8.1.250.0060.00328.09
8.1.240.0060.00323.73
8.1.230.0080.00419.14
8.1.220.0080.00017.80
8.1.210.0050.00318.77
8.1.200.0070.00317.61
8.1.190.0080.00017.63
8.1.180.0060.00318.93
8.1.170.0000.00918.62
8.1.160.0000.00722.19
8.1.150.0000.00818.84
8.1.140.0000.00717.59
8.1.130.0000.00717.87
8.1.120.0000.00717.57
8.1.110.0000.00817.70
8.1.100.0040.00417.61
8.1.90.0040.00417.52
8.1.80.0000.00717.63
8.1.70.0000.00717.64
8.1.60.0030.00517.70
8.1.50.0090.00017.64
8.1.40.0040.00417.69
8.1.30.0030.00617.80
8.1.20.0000.00917.84
8.1.10.0030.00517.82
8.1.00.0040.00417.77
8.0.300.0070.00018.77
8.0.290.0040.00417.17
8.0.280.0030.00318.57
8.0.270.0050.00217.21
8.0.260.0030.00317.05
8.0.250.0070.00017.25
8.0.240.0040.00417.26
8.0.230.0040.00417.13
8.0.220.0030.00517.09
8.0.210.0000.00717.06
8.0.200.0000.00717.29
8.0.190.0080.00017.10
8.0.180.0000.00717.21
8.0.170.0040.00417.13
8.0.160.0060.00317.17
8.0.150.0050.00317.15
8.0.140.0000.00717.02
8.0.130.0060.00013.59
8.0.120.0040.00417.04
8.0.110.0030.00517.17
8.0.100.0000.00717.26
8.0.90.0070.00017.11
8.0.80.0030.01317.22
8.0.70.0030.00517.20
8.0.60.0050.00316.99
8.0.50.0030.00516.96
8.0.30.0090.01217.24
8.0.20.0120.00817.48
8.0.10.0030.00617.21
8.0.00.0140.00717.05
7.4.330.0000.00515.11
7.4.320.0030.00316.86
7.4.300.0000.00616.88
7.4.290.0000.00816.87
7.4.280.0000.00716.84
7.4.270.0030.00316.88
7.4.260.0060.00316.85
7.4.250.0000.00716.73
7.4.240.0040.00416.88
7.4.230.0000.00716.97
7.4.220.0040.01516.91
7.4.210.0090.00716.83
7.4.200.0050.00216.97
7.4.190.0000.00716.93
7.4.160.0170.00016.73
7.4.150.0060.01217.40
7.4.140.0070.01217.86
7.4.130.0100.01216.98
7.4.120.0120.00616.91
7.4.110.0100.01016.63
7.4.100.0130.00416.66
7.4.90.0110.00716.84
7.4.80.0120.01219.39
7.4.70.0110.00916.71
7.4.60.0070.01016.73
7.4.50.0050.00516.73
7.4.40.0000.01322.77
7.4.30.0040.01416.81
7.4.00.0110.00714.96
7.3.330.0050.00013.42
7.3.320.0060.00013.39
7.3.310.0040.00316.55
7.3.300.0000.00716.62
7.3.290.0110.00316.54
7.3.280.0050.01216.52
7.3.270.0100.00817.40
7.3.260.0110.00816.57
7.3.250.0100.00816.79
7.3.240.0030.01416.77
7.3.230.0120.00916.84
7.3.210.0050.01416.67
7.3.200.0130.00316.76
7.3.190.0110.00716.57
7.3.180.0090.00616.73
7.3.170.0030.01316.71
7.3.160.0080.00816.60
7.3.120.0090.00614.95
7.3.10.0080.00816.93
7.3.00.0030.01016.64
7.2.330.0030.01616.93
7.2.320.0030.01416.95
7.2.310.0030.01816.84
7.2.300.0030.01417.06
7.2.290.0080.00916.80
7.2.130.0030.01016.92
7.2.120.0090.00617.18
7.2.110.0070.00416.93
7.2.100.0040.01117.26
7.2.90.0060.00917.07
7.2.80.0100.00017.21
7.2.70.0050.00517.12
7.2.60.0060.00917.16
7.2.50.0070.00317.13
7.2.40.0000.01417.04
7.2.30.0040.01216.99
7.2.20.0090.00317.12
7.2.10.0080.00816.98
7.2.00.0050.01018.36
7.1.250.0070.00715.69
7.1.200.0070.00716.00
7.1.100.0040.00418.26
7.1.70.0070.00017.29
7.1.60.0040.00817.63
7.1.50.0040.00717.23
7.1.00.0000.08022.45
7.0.200.0030.01017.04
7.0.140.0030.07022.01
7.0.60.0030.09020.05
7.0.50.0030.05717.95
7.0.40.0070.08720.26
7.0.30.0300.07720.25
7.0.20.0300.08020.17
7.0.10.0100.04720.11
7.0.00.0000.04320.32
5.6.280.0000.07721.00
5.6.210.0070.08020.68
5.6.200.0100.05318.17
5.6.190.0130.08320.61
5.6.180.0200.06720.77
5.6.170.0230.04720.71
5.6.160.0070.07020.46
5.6.150.0030.05018.16
5.6.140.0030.05318.18
5.6.130.0030.08718.16
5.6.120.0270.07321.16
5.6.110.0000.08321.00
5.6.100.0070.07020.98
5.6.90.0100.04021.09
5.6.80.0070.05020.42
5.5.350.3200.04320.43
5.5.340.0000.04018.08
5.5.330.0030.05320.27
5.5.320.0530.07020.35
5.5.310.0470.04320.34
5.5.300.0170.04017.99
5.5.290.0130.07017.95
5.5.280.0030.09320.89
5.5.270.0100.05320.91
5.5.260.0070.04720.78
5.5.250.0130.07020.52
5.5.240.0230.07020.30
5.4.450.0500.03719.55
5.4.440.0370.04019.41
5.4.430.0370.04019.18
5.4.420.0500.05019.47
5.4.410.0330.04319.34
5.4.400.0300.04019.16
5.4.390.0430.03719.22
5.4.380.0300.04319.09
5.4.370.0330.03719.09
5.4.360.0330.04319.14
5.4.350.0370.03319.09
5.4.340.0400.03718.99
5.4.320.0300.04019.08
5.4.310.0300.04018.99
5.4.300.0370.04019.30
5.4.290.0500.03319.19
5.4.280.0400.03719.06
5.4.270.0330.03719.24
5.4.260.0530.02719.14
5.4.250.0330.03718.94
5.4.240.0330.03718.94
5.4.230.0370.03319.08
5.4.220.0330.04719.07
5.4.210.0400.04018.96
5.4.200.0370.03318.95
5.4.190.0370.03319.30
5.4.180.0430.04318.86
5.4.170.0470.03719.34
5.4.160.0330.03719.06
5.4.150.0330.03719.09
5.4.140.0370.03316.72
5.4.130.0370.07016.33
5.4.120.0500.06316.39
5.4.110.0330.03716.59
5.4.100.0300.04016.63
5.4.90.0470.06316.55
5.4.80.0370.03016.50
5.4.70.0270.06316.31
5.4.60.0330.04316.22
5.4.50.0370.04716.52
5.4.40.0330.03716.56
5.4.30.0330.03716.52
5.4.20.0300.03716.51
5.4.10.0470.04316.52
5.4.00.0270.04015.86
5.3.290.0330.04014.73
5.3.280.0330.04014.70
5.3.270.0330.04014.85
5.3.260.0300.04314.60
5.3.250.0330.04014.61
5.3.240.0300.04014.64
5.3.230.0500.06014.70
5.3.220.0430.03714.64
5.3.210.0370.04314.58
5.3.200.0330.04014.56
5.3.190.0430.04014.60
5.3.180.0370.03314.80
5.3.170.0500.06014.80
5.3.160.0330.03714.49
5.3.150.0270.04714.63
5.3.140.0370.04014.48
5.3.130.0430.04714.54
5.3.120.0370.03714.47
5.3.110.0370.03314.68
5.3.100.0330.03714.06
5.3.90.0500.06014.11
5.3.80.0400.03013.94
5.3.70.0470.07014.12
5.3.60.0370.04014.03
5.3.50.0400.03013.90
5.3.40.0370.03313.95
5.3.30.0400.03014.04
5.3.20.0400.03013.72
5.3.10.0300.04013.68
5.3.00.0430.03713.59
5.2.170.0270.03011.57
5.2.160.0330.02311.57
5.2.150.0300.02711.57
5.2.140.0330.03711.57
5.2.130.0300.03311.57
5.2.120.0330.03011.57
5.2.110.0270.03011.57
5.2.100.0300.03311.57
5.2.90.0470.04311.57
5.2.80.0330.04711.57
5.2.70.0300.04711.57
5.2.60.0400.05311.57
5.2.50.0300.03711.57
5.2.40.0200.03011.57
5.2.30.0300.03011.57
5.2.20.0330.02311.57
5.2.10.0230.03011.57
5.2.00.0230.03311.57
5.1.60.0300.03711.57
5.1.50.0230.02711.57
5.1.40.0270.03711.57
5.1.30.0330.04011.57
5.1.20.0230.02311.57
5.1.10.0230.03011.57
5.1.00.0300.02011.57
5.0.50.0170.02011.57
5.0.40.0100.02311.57
5.0.30.0230.04711.57
5.0.20.0130.03011.57
5.0.10.0170.01711.57
5.0.00.0130.03011.57
4.4.90.0230.02311.57
4.4.80.0170.03011.57
4.4.70.0170.01311.57
4.4.60.0100.01711.57
4.4.50.0130.02711.57
4.4.40.0100.03011.57
4.4.30.0130.03011.57
4.4.20.0130.02711.57
4.4.10.0100.01711.57
4.4.00.0030.03311.57
4.3.110.0130.01311.57
4.3.100.0130.03311.57
4.3.90.0200.01011.57
4.3.80.0130.03311.57
4.3.70.0230.02311.57
4.3.60.0170.02711.57
4.3.50.0130.03711.57
4.3.40.0170.03711.57
4.3.30.0070.04011.57
4.3.20.0070.03711.57
4.3.10.0070.03711.57
4.3.00.0030.02311.57

preferences:
40.32 ms | 401 KiB | 5 Q