3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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 $id = 0; function __construct($a1) { $this->id = $a1; } function getHMTL() { $regexatt = '/\<table class="ad-attributes">(.*)\<\/table\>/'; preg_match($regexatt, $this->id, $matches); $a = $matches[1]; $regexcontent = '/\<div id="UserContent">(.*)\<\/div\>/'; preg_match($regexcontent, $this->id, $matches); $b = $matches[1]; return $a . $b; } } //'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_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>"; $liste = new AdsListExtractor($html_liste); $ad_info = new AdInfoExtractor($liste->getURLs()[1]); 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.0040.01118.55
8.3.50.0100.00821.27
8.3.40.0030.01319.17
8.3.30.0090.00619.02
8.3.20.0000.00820.33
8.3.10.0040.00422.05
8.3.00.0060.00320.64
8.2.180.0100.01017.13
8.2.170.0150.00022.96
8.2.160.0110.00419.39
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0090.00926.16
8.2.120.0000.00819.74
8.2.110.0100.00019.27
8.2.100.0060.00620.01
8.2.90.0090.00019.26
8.2.80.0080.00017.97
8.2.70.0080.00018.00
8.2.60.0030.00618.05
8.2.50.0040.00418.07
8.2.40.0030.00518.16
8.2.30.0000.00718.25
8.2.20.0040.00417.99
8.2.10.0000.00817.97
8.2.00.0000.00817.96
8.1.280.0150.00025.92
8.1.270.0040.00422.18
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00322.68
8.1.230.0060.00619.06
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.47
8.1.190.0050.00517.66
8.1.180.0040.00418.72
8.1.170.0060.00318.66
8.1.160.0040.00422.09
8.1.150.0040.00418.62
8.1.140.0000.00717.45
8.1.130.0000.00717.92
8.1.120.0040.00417.43
8.1.110.0000.00817.55
8.1.100.0050.00317.45
8.1.90.0080.00017.56
8.1.80.0050.00217.55
8.1.70.0000.00717.57
8.1.60.0050.00317.67
8.1.50.0030.00517.70
8.1.40.0030.00517.56
8.1.30.0040.00417.73
8.1.20.0000.00817.83
8.1.10.0080.00017.77
8.1.00.0030.00717.72
8.0.300.0040.00418.77
8.0.290.0040.00417.18
8.0.280.0000.00718.48
8.0.270.0040.00417.20
8.0.260.0040.00417.05
8.0.250.0030.00317.08
8.0.240.0030.00517.17
8.0.230.0030.00317.19
8.0.220.0030.00317.12
8.0.210.0070.00017.08
8.0.200.0030.00317.16
8.0.190.0060.00317.16
8.0.180.0040.00417.04
8.0.170.0030.00517.08
8.0.160.0040.00417.14
8.0.150.0080.00017.05
8.0.140.0030.00616.96
8.0.130.0000.00613.47
8.0.120.0000.00817.14
8.0.110.0040.00417.15
8.0.100.0040.00417.07
8.0.90.0070.00016.96
8.0.80.0060.00917.07
8.0.70.0000.00716.96
8.0.60.0040.00416.93
8.0.50.0000.00817.13
8.0.30.0120.00717.39
8.0.20.0080.01117.40
8.0.10.0040.00317.00
8.0.00.0060.01216.75
7.4.330.0030.00315.00
7.4.320.0070.00016.78
7.4.300.0030.00316.84
7.4.290.0000.00816.82
7.4.280.0070.00016.77
7.4.270.0070.00016.77
7.4.260.0060.00316.73
7.4.250.0040.00416.68
7.4.240.0010.00616.75
7.4.230.0070.00016.74
7.4.220.0090.00916.78
7.4.210.0070.00816.78
7.4.200.0000.00716.85
7.4.190.0040.00416.87
7.4.160.0090.01216.81
7.4.150.0110.00717.40
7.4.140.0120.00617.86
7.4.130.0080.01216.75
7.4.120.0050.01116.81
7.4.110.0120.00416.85
7.4.100.0090.00916.60
7.4.90.0130.01016.68
7.4.80.0150.00619.39
7.4.70.0040.01816.70
7.4.60.0070.01016.88
7.4.50.0030.00516.78
7.4.40.0100.00322.77
7.4.30.0090.00916.73
7.4.00.0090.00915.11
7.3.330.0020.00213.40
7.3.320.0050.00013.61
7.3.310.0040.00416.49
7.3.300.0000.00716.49
7.3.290.0080.00816.55
7.3.280.0120.00616.59
7.3.270.0100.00717.40
7.3.260.0130.00616.72
7.3.250.0120.00516.76
7.3.240.0120.00616.79
7.3.230.0160.00316.90
7.3.210.0030.01316.54
7.3.200.0100.01019.39
7.3.190.0100.01116.74
7.3.180.0030.01416.41
7.3.170.0030.01416.77
7.3.160.0040.01316.70
7.3.120.0120.00315.07
7.2.330.0100.00716.80
7.2.320.0100.01016.69
7.2.310.0130.00617.02
7.2.300.0070.01016.94
7.2.290.0130.00316.88
7.1.70.0030.00917.38
7.1.60.0090.00619.82
7.1.50.0110.01117.24
7.1.00.0030.07322.50
7.0.200.0040.00417.03
7.0.140.0000.07322.00
7.0.100.0300.03719.92
7.0.90.0230.04019.99
7.0.80.0100.04320.00
7.0.70.0170.04020.02
7.0.60.0230.04719.97
7.0.50.0500.08720.34
7.0.40.0000.09020.19
7.0.30.0070.05320.12
7.0.20.0200.06320.02
7.0.10.0170.07020.18
7.0.00.0070.08020.08
5.6.280.0070.07320.84
5.6.250.0000.04320.68
5.6.240.0100.06020.56
5.6.230.0000.04320.69
5.6.220.0130.07020.51
5.6.210.0070.04720.57
5.6.200.0100.05721.10
5.6.190.0070.07721.13
5.6.180.0030.08021.10
5.6.170.0130.07321.11
5.6.160.0130.04321.08
5.6.150.0100.08321.10
5.6.140.0070.08321.12
5.6.130.0100.07320.98
5.6.120.0030.05721.05
5.6.110.0070.08321.05
5.6.100.0100.08321.05
5.6.90.0100.08021.16
5.6.80.0130.07720.53
5.6.70.0000.08320.33
5.6.60.0070.07720.52
5.6.50.0000.07720.45
5.6.40.0100.08020.46
5.6.30.0070.04720.33
5.6.20.0130.07020.40
5.6.10.0000.05720.40
5.6.00.0070.06720.38
5.5.380.0000.04320.38
5.5.370.0070.04020.53
5.5.360.0070.03720.50
5.5.350.0030.04020.40
5.5.340.0130.06720.66
5.5.330.0030.08320.89
5.5.320.0100.07320.91
5.5.310.0130.08020.85
5.5.300.0130.07720.78
5.5.290.0100.08320.84
5.5.280.0030.09020.85
5.5.270.0100.08720.81
5.5.260.0070.09020.87
5.5.250.0070.08320.74
5.5.240.0170.06720.16
5.5.230.0130.04320.15
5.5.220.0130.03320.25
5.5.210.0030.08020.27
5.5.200.0100.05720.22
5.5.190.0100.08020.19
5.5.180.0130.07720.26
5.5.160.0100.07720.26
5.5.150.0100.07320.14
5.5.140.0030.07720.28
5.5.130.0170.07320.26
5.5.120.0130.07020.19
5.5.110.0100.07320.22
5.5.100.0170.04320.09
5.5.90.0200.06020.16
5.5.80.0130.06720.13
5.5.70.0070.08320.11
5.5.60.0200.06020.08
5.5.50.0130.06720.04
5.5.40.0070.06320.05
5.5.30.0100.07720.04
5.5.20.0200.05020.04
5.5.10.0130.07320.14
5.5.00.0030.08020.09
5.4.450.0070.07319.42
5.4.440.0030.08019.36
5.4.430.0130.07019.43
5.4.420.0030.08019.45
5.4.410.0100.08019.40
5.4.400.0030.04719.05
5.4.390.0100.07019.18
5.4.380.0070.07319.16
5.4.370.0000.04719.21
5.4.360.0070.08019.04
5.4.350.0030.07319.12
5.4.340.0200.06319.06
5.4.320.0100.07719.09
5.4.310.0070.07319.25
5.4.300.0130.06719.09
5.4.290.0130.06318.95
5.4.280.0130.04018.89
5.4.270.0070.07719.13
5.4.260.0070.07319.23
5.4.250.0100.07718.94
5.4.240.0030.08018.84
5.4.230.0100.07019.03
5.4.220.0130.06019.20
5.4.210.0030.08019.20
5.4.200.0000.08019.12
5.4.190.0000.08718.89
5.4.180.0100.05718.84
5.4.170.0030.08019.17
5.4.160.0070.06719.11
5.4.150.0030.07718.85
5.4.140.0100.07016.41
5.4.130.0000.07716.33
5.4.120.0000.07316.42
5.4.110.0070.07016.39
5.4.100.0070.07316.60
5.4.90.0100.07016.45
5.4.80.0000.05316.39
5.4.70.0100.07016.52
5.4.60.0170.06016.48
5.4.50.0070.07316.44
5.4.40.0030.06716.50
5.4.30.0200.04316.49
5.4.20.0030.07716.48
5.4.10.0070.04716.30
5.4.00.0070.07015.72
5.3.290.0070.08314.77
5.3.280.0130.06714.67
5.3.270.0100.07314.60
5.3.260.0070.07314.71
5.3.250.0200.06014.71
5.3.240.0070.06314.52
5.3.230.0070.07314.63
5.3.220.0100.05714.69
5.3.210.0100.07314.69
5.3.200.0100.07014.59
5.3.190.0070.08014.67
5.3.180.0070.07714.63
5.3.170.0100.06714.71
5.3.160.0030.07714.56
5.3.150.0100.04314.55
5.3.140.0070.07314.57
5.3.130.0130.06714.67
5.3.120.0170.06714.54
5.3.110.0030.07714.63
5.3.100.0030.07714.04
5.3.90.0100.06714.10
5.3.80.0130.06714.02
5.3.70.0100.03714.02
5.3.60.0070.07014.13
5.3.50.0070.07013.89
5.3.40.0070.06013.85
5.3.30.0000.05713.81
5.3.20.0070.07313.68
5.3.10.0130.06713.65
5.3.00.0030.07313.58
5.2.170.0070.06011.23
5.2.160.0000.06011.07
5.2.150.0130.05311.19
5.2.140.0100.05011.07
5.2.130.0030.03311.04
5.2.120.0130.05311.24
5.2.110.0030.06310.99
5.2.100.0030.04011.13
5.2.90.0070.05711.12
5.2.80.0030.03310.97
5.2.70.0030.06710.97
5.2.60.0000.07011.00
5.2.50.0070.06010.93
5.2.40.0100.05310.89
5.2.30.0000.03711.01
5.2.20.0030.05710.83
5.2.10.0100.06010.95
5.2.00.0000.06310.74
5.1.60.0100.05010.01
5.1.50.0030.05710.01
5.1.40.0030.05010.11
5.1.30.0030.05310.38
5.1.20.0030.04010.42
5.1.10.0100.05010.16
5.1.00.0000.06310.16
5.0.50.0030.0478.43
5.0.40.0030.0438.51
5.0.30.0000.0678.32
5.0.20.0030.0408.25
5.0.10.0000.0478.26
5.0.00.0100.0438.27
4.4.90.0000.0378.14
4.4.80.0030.0338.14
4.4.70.0000.0278.14
4.4.60.0000.0408.14
4.4.50.0030.0338.14
4.4.40.0070.0508.14
4.4.30.0000.0338.14
4.4.20.0030.0338.14
4.4.10.0130.0278.14
4.4.00.0030.0508.14
4.3.110.0030.0238.14
4.3.100.0030.0338.14
4.3.90.0000.0378.14
4.3.80.0000.0538.14
4.3.70.0030.0338.14
4.3.60.0030.0308.14
4.3.50.0000.0378.14
4.3.40.0130.0408.14
4.3.30.0000.0278.14
4.3.20.0030.0338.14
4.3.10.0000.0338.14
4.3.00.0000.0378.14

preferences:
47.12 ms | 401 KiB | 5 Q