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 = 0; 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[0] . $b[0]; } } class HTMLReader { function getHMTL($url) { return 'dhoaudg od oaeywgdoad<table class="ad-attributes">yessssssss\</table>' . 'dfdssd<div id="UserContent">fggee</div>/'; } } //'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); $liste = new AdsListExtractor($html_test); foreach ($liste->getURLs() as $line_num => $line) { $ad_info = new AdInfoExtractor($line); echo $ad_info->getHMTL(); }

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.48
8.3.50.0120.00922.24
8.3.40.0110.00719.05
8.3.30.0120.00319.04
8.3.20.0080.00020.39
8.3.10.0080.00021.95
8.3.00.0040.00422.34
8.2.180.0070.00717.13
8.2.170.0150.00022.96
8.2.160.0030.01019.25
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.01126.16
8.2.120.0040.00419.50
8.2.110.0060.00320.34
8.2.100.0080.00418.03
8.2.90.0040.00419.40
8.2.80.0000.00817.97
8.2.70.0030.00717.74
8.2.60.0030.00618.03
8.2.50.0080.00018.07
8.2.40.0050.00318.34
8.2.30.0040.00418.22
8.2.20.0040.00417.84
8.2.10.0000.00817.89
8.2.00.0050.00318.04
8.1.280.0120.00325.92
8.1.270.0080.00021.94
8.1.260.0030.00626.35
8.1.250.0060.00328.09
8.1.240.0070.00321.12
8.1.230.0040.00817.77
8.1.220.0060.00317.77
8.1.210.0090.00018.77
8.1.200.0060.00317.60
8.1.190.0000.00817.65
8.1.180.0060.00318.88
8.1.170.0050.00318.71
8.1.160.0070.00022.25
8.1.150.0070.00018.75
8.1.140.0060.00317.51
8.1.130.0000.00817.76
8.1.120.0000.00717.64
8.1.110.0000.00817.63
8.1.100.0040.00417.53
8.1.90.0040.00417.54
8.1.80.0030.00317.66
8.1.70.0030.00717.63
8.1.60.0030.00617.80
8.1.50.0000.00817.70
8.1.40.0040.00417.58
8.1.30.0050.00317.88
8.1.20.0030.00617.84
8.1.10.0000.00817.82
8.1.00.0030.00617.73
8.0.300.0060.00318.77
8.0.290.0030.00617.00
8.0.280.0000.00718.38
8.0.270.0080.00017.36
8.0.260.0000.00717.08
8.0.250.0040.00417.09
8.0.240.0030.00317.21
8.0.230.0040.00417.17
8.0.220.0000.00717.12
8.0.210.0000.00717.18
8.0.200.0030.00317.24
8.0.190.0040.00417.07
8.0.180.0070.00017.04
8.0.170.0040.00417.03
8.0.160.0050.00317.00
8.0.150.0040.00417.17
8.0.140.0080.00016.99
8.0.130.0030.00313.59
8.0.120.0080.00017.10
8.0.110.0000.00917.16
8.0.100.0080.00017.01
8.0.90.0000.00816.98
8.0.80.0090.00617.11
8.0.70.0050.00216.94
8.0.60.0040.00417.18
8.0.50.0050.00317.01
8.0.30.0090.01217.34
8.0.20.0140.00617.51
8.0.10.0070.00017.14
8.0.00.0080.01116.99
7.4.330.0000.00515.12
7.4.320.0070.00016.86
7.4.300.0000.00616.73
7.4.290.0000.00716.65
7.4.280.0050.00216.75
7.4.270.0000.00716.87
7.4.260.0060.00316.73
7.4.250.0040.00416.75
7.4.240.0040.00416.78
7.4.230.0030.00316.60
7.4.220.0070.01116.88
7.4.210.0070.00916.86
7.4.200.0070.00016.50
7.4.190.0040.00416.95
7.4.160.0130.00316.80
7.4.150.0090.00917.40
7.4.140.0010.02017.86
7.4.130.0140.00716.70
7.4.120.0110.00616.66
7.4.110.0070.01116.98
7.4.100.0120.00916.95
7.4.90.0110.01116.63
7.4.80.0140.00319.39
7.4.70.0110.01216.80
7.4.60.0130.00416.79
7.4.50.0040.00016.89
7.4.40.0030.01022.77
7.4.30.0090.00916.85
7.4.00.0030.01015.29
7.3.330.0000.00613.41
7.3.320.0050.00013.40
7.3.310.0070.00016.55
7.3.300.0000.00716.59
7.3.290.0060.01116.55
7.3.280.0120.00816.51
7.3.270.0030.01417.40
7.3.260.0100.01016.50
7.3.250.0150.00116.50
7.3.240.0110.00516.77
7.3.230.0200.00016.70
7.3.210.0100.00716.81
7.3.200.0100.00619.39
7.3.190.0130.00916.68
7.3.180.0060.01216.79
7.3.170.0090.00916.72
7.3.160.0060.00916.68
7.3.120.0000.01214.88
7.2.330.0110.00716.73
7.2.320.0140.00316.95
7.2.310.0100.01016.92
7.2.300.0100.00716.87
7.2.290.0030.01516.96
7.1.200.0070.00716.03
7.1.70.0060.00617.49
7.1.60.0090.00319.82
7.1.50.0030.02116.91
7.1.00.0030.07722.38
7.0.200.0030.01016.77
7.0.140.0030.07322.09
7.0.60.0070.07719.85
7.0.50.0100.07717.93
7.0.40.0000.05720.28
7.0.30.0230.04020.08
7.0.20.0200.08720.10
7.0.10.0130.04720.32
7.0.00.0030.05320.11
5.6.210.0100.07020.71
5.6.200.0030.09018.16
5.6.190.0100.04320.77
5.6.180.0230.05020.34
5.6.170.0400.07720.54
5.6.160.0130.07320.54
5.6.150.0100.08318.18
5.6.140.0100.07318.25
5.6.130.0130.07318.24
5.6.120.0070.06721.07
5.6.110.0130.06021.14
5.6.100.0300.05721.13
5.6.90.0100.08021.02
5.6.80.0070.05720.54
5.5.350.0070.08020.51
5.5.340.0070.07018.03
5.5.330.0030.06020.56
5.5.320.0230.06720.42
5.5.310.0370.07720.31
5.5.300.0200.05317.99
5.5.290.0100.07317.97
5.5.280.0130.05020.82
5.5.270.0030.04720.82
5.5.260.0100.08720.89
5.5.250.0070.04720.73
5.5.240.4230.03320.27
5.4.450.0500.05719.46
5.4.440.0900.05719.58
5.4.430.0800.05019.49
5.4.420.1030.05319.56
5.4.410.0130.06019.47
5.4.400.0670.05719.16
5.4.390.0230.05719.25
5.4.380.0330.06718.58
5.4.370.0330.05318.61
5.4.360.0330.04718.54
5.4.350.0200.05018.76
5.4.340.0330.05318.48
5.4.320.0060.03612.52
5.4.310.0070.04212.51
5.4.300.0080.04412.52
5.4.290.0080.03812.51
5.4.280.0060.04012.41
5.4.270.0020.04212.41
5.4.260.0170.07018.80
5.4.250.0070.05718.75
5.4.240.0030.05718.76
5.4.230.0100.05018.93
5.4.220.0130.07019.02
5.4.210.0030.06319.02
5.4.200.0070.08318.95
5.4.190.0030.06018.64
5.4.180.0200.06019.08
5.4.170.0000.08318.75
5.4.160.0200.05718.82
5.4.150.0070.08718.86
5.4.140.0130.05016.39
5.4.130.0230.04016.38
5.4.120.0030.05716.56
5.4.110.0070.05316.46
5.4.100.0070.05716.51
5.4.90.0170.04316.66
5.4.80.0170.04016.53
5.4.70.0070.07016.46
5.4.60.0170.05316.48
5.4.50.0130.06316.44
5.4.40.0130.05316.44
5.4.30.0070.07016.44
5.4.20.0100.05016.58
5.4.10.0030.08016.37
5.4.00.0030.05315.81
5.3.290.0080.03812.80
5.3.280.0030.07014.70
5.3.270.0130.05314.85
5.3.260.0200.06714.53
5.3.250.0100.05714.72
5.3.240.0070.05314.53
5.3.230.0100.06714.77
5.3.220.0200.04014.65
5.3.210.0100.05314.68
5.3.200.0030.06014.67
5.3.190.0030.07314.77
5.3.180.0130.05014.68
5.3.170.0070.05314.67
5.3.160.0170.06014.57
5.3.150.0070.07014.72
5.3.140.0130.06714.55
5.3.130.0130.08014.71
5.3.120.0070.07014.64
5.3.110.0130.05014.66
5.3.100.0030.06314.07
5.3.90.0030.08013.96
5.3.80.0170.06314.11
5.3.70.0100.07014.00
5.3.60.0030.07014.05
5.3.50.0230.05314.04
5.3.40.0030.06314.05
5.3.30.0130.05313.95
5.3.20.0100.06313.90
5.3.10.0070.06713.77
5.3.00.0100.05713.64
5.2.170.0070.04711.12
5.2.160.0070.05711.34
5.2.150.0130.03711.15
5.2.140.0070.06011.14
5.2.130.0030.06311.21
5.2.120.0070.04711.14
5.2.110.0070.05711.20
5.2.100.0200.04711.13
5.2.90.0270.03710.98
5.2.80.0070.06011.09
5.2.70.0170.04711.31
5.2.60.0100.03711.06
5.2.50.0100.04011.02
5.2.40.0030.04711.04
5.2.30.0070.05711.08
5.2.20.0100.03711.07
5.2.10.0130.04710.95
5.2.00.0030.05710.72
5.1.60.0030.04010.09
5.1.50.0130.0409.94
5.1.40.0070.05010.09
5.1.30.0200.03710.42
5.1.20.0030.05010.57
5.1.10.0030.03710.15
5.1.00.0070.03310.19
5.0.50.0000.0308.53
5.0.40.0070.0278.52
5.0.30.0000.0438.21
5.0.20.0030.0308.46
5.0.10.0000.0308.39
5.0.00.0100.0478.25
4.4.90.0070.0276.26
4.4.80.0070.0176.26
4.4.70.0000.0276.26
4.4.60.0070.0276.26
4.4.50.0000.0306.26
4.4.40.0000.0436.26
4.4.30.0030.0306.26
4.4.20.0070.0276.26
4.4.10.0030.0206.26
4.4.00.0000.0436.26
4.3.110.0000.0236.26
4.3.100.0070.0176.26
4.3.90.0030.0206.26
4.3.80.0070.0306.26
4.3.70.0030.0206.26
4.3.60.0030.0236.26
4.3.50.0100.0136.26
4.3.40.0000.0336.26
4.3.30.0000.0306.26
4.3.20.0030.0236.26
4.3.10.0000.0236.26
4.3.00.0070.0238.11

preferences:
46.86 ms | 401 KiB | 5 Q