3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Needs: - Shirt sizes Would it be easier to use the mobile version? http://m.teefury.com/ Also, use http://codepad.viper-7.com to check to see how the code is scraping */ /** * filename teefury.php * * This does a basic scraping of the desktop version of the Teefury homepage. Obtains the * prices, names, colors, etc., and is used for putting that data into XML. * * @author Katie Pham <kaytee.pham@gmail.com> */ // Required to print out XML header('Content-Type: application/xml'); $output = file_get_contents('http://www.teefury.com/'); $regex_title = '#"og:title" content="(.+?)"#'; $regex_shirtimg = '#og:image" content="(.+?)"#'; $regex_price = '/<span class="price">(.+?)<\/span>/s'; $twofury = FALSE; $nodisplay = 'style="display: none;"'; preg_match($regex_title, $output, $match_title); preg_match($regex_price, $output, $match_price); echo 'Price: ' . $match_price[1] . '<br />'; //var_dump($match); // Let's go here if it's Twofury if ($match_title[1] == 'The Limited Edition Cheap T-Shirt, Gone in 24hours!') { $twofury = TRUE; // Shirt images preg_match_all($regex_shirtimg, $output, $match_shirtimg); // Shirt names and authors $regex_names = '#<span class="shirt_title">(.+?)</span>#'; preg_match_all($regex_names, $output, $match_names); $regex_author_left = '#<span class="by_link_left">by <a href="(.+?)">(.+?)</a></span>#'; $regex_author_right = '#<span class="by_link_right">by <a href="(.+?)">(.+?)</a></span>#'; preg_match($regex_author_left, $output, $match_author_left); preg_match($regex_author_right, $output, $match_author_right); // Note--1st element = URL echo 'Left author: ' . $match_author_left[2] . '<br />'; echo 'Right author: ' . $match_author_right[2] . '<br />'; // Leader $regex_leader = '#class=\"current_leader_(.+?)\"(.+?)#'; $leader_image = "/images/current_leader.png"; preg_match_all($regex_leader, $output, $match_leader); $current_leader = "Leader: None"; if ($match_leader[2][0] == ' ' || $match_leader[2][1] == '/') { $current_leader = "Leader: Right"; } else if ($match_leader[2][1] == ' ' || $match_leader[2][0] == '/') { $current_leader = "Leader: Left"; } echo $current_leader . '<br />'; // Colors // Men's $regex_colors_left_men = '#<span class="qtip mens-color-box" id="(.+?)" data-hex="\#(.+?)" rel="(.+?)" style="background-color: (.+?); " title="(.+?)" data-color-name="(.+?)" data-identifier="a">#'; preg_match_all($regex_colors_left_men, $output, $match_colors_left_men); $regex_colors_right_men = '#<span class="qtip mens-color-box" id="(.+?)" data-hex="\#(.+?)" rel="(.+?)" style="background-color: (.+?); " title="(.+?)" data-color-name="(.+?)" data-identifier="b">#'; preg_match_all($regex_colors_right_men, $output, $match_colors_right_men); // Women's $regex_colors_left_women = '#<span class="qtip womens-color-box" id="(.+?)" data-hex="\#(.+?)" rel="(.+?)" style="background-color: (.+?); " title="(.+?)" data-color-name="(.+?)" data-identifier="a">#'; preg_match_all($regex_colors_left_women, $output, $match_colors_left_women); $regex_colors_right_women = '#<span class="qtip womens-color-box" id="(.+?)" data-hex="\#(.+?)" rel="(.+?)" style="background-color: (.+?); " title="(.+?)" data-color-name="(.+?)" data-identifier="b">#'; preg_match_all($regex_colors_right_women, $output, $match_colors_right_women); // Display shirt names, shirt images, and prices for($i = 0; $i < count($match_shirtimg[1]); $i++) { echo 'Shirt ' . $i . ' (' . $match_names[1][$i] . '): ' . $match_shirtimg[1][$i] . '<br />'; // Left shirt's info if ($i == 0) { for ($j = 0; $j < count($match_colors_left_men[4]); $j++) { echo 'Colors for men\'s: ' . $match_colors_left_men[4][$j] . ' (' . $match_colors_left_men[6][$j] . ')<br />'; } for ($j = 0; $j < count($match_colors_left_women[4]); $j++) { echo 'Colors for women\'s: ' . $match_colors_left_women[4][$j] . ' (' . $match_colors_left_women[6][$j] . ')<br />'; } } else { for ($j = 0; $j < count($match_colors_right_men[4]); $j++) { echo 'Colors for men\'s: ' . $match_colors_right_men[4][$j] . ' (' . $match_colors_right_men[6][$j] . ')<br />'; } for ($j = 0; $j < count($match_colors_right_women[4]); $j++) { echo 'Colors for women\'s: ' . $match_colors_right_women[4][$j] . ' (' . $match_colors_right_women[6][$j] . ')<br />'; } } } } // Nope, just a plain old day // Needs to be worked on! // Also needs: // - Author // - Shirt colors // - Price // - Sizes else { echo $match_title[1] . 'Regular Teefury!'; $regex_name = '#<span id=\'p-title\'>(.+?)<\/span>#'; preg_match($regex_name, $output, $match_name); preg_match($regex_shirtimg, $output, $match_shirt); echo 'Shirt ' . $i . ' (' . $match_name[1] . '): ' . $match_shirtimg[1] . '<br />'; } ?>

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.00717.38
8.3.50.0130.01017.02
8.3.40.0120.00319.42
8.3.30.0150.00019.38
8.3.20.0040.00419.41
8.3.10.0080.00019.35
8.3.00.0090.00919.88
8.2.180.0120.00325.92
8.2.170.0190.00319.41
8.2.160.0080.00622.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00919.81
8.2.110.0050.00520.73
8.2.100.0070.00719.95
8.2.90.0050.00318.25
8.2.80.0000.00819.41
8.2.70.0050.00318.25
8.2.60.0000.00818.18
8.2.50.0030.00618.07
8.2.40.0030.00619.85
8.2.30.0030.00918.25
8.2.20.0030.00718.07
8.2.10.0000.00918.32
8.2.00.0050.00518.37
8.1.280.0130.00325.92
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00020.98
8.1.230.0060.00622.45
8.1.220.0000.00917.86
8.1.210.0040.00418.77
8.1.200.0040.00417.85
8.1.190.0060.00617.63
8.1.180.0090.00018.10
8.1.170.0000.01118.96
8.1.160.0050.00219.24
8.1.150.0030.00619.00
8.1.140.0040.00417.89
8.1.130.0020.00517.89
8.1.120.0080.00017.84
8.1.110.0040.00417.92
8.1.100.0000.00717.95
8.1.90.0070.00017.68
8.1.80.0030.00617.84
8.1.70.0000.00717.78
8.1.60.0030.00518.06
8.1.50.0080.00017.81
8.1.40.0000.00817.91
8.1.30.0030.00618.07
8.1.20.0060.00618.02
8.1.10.0000.00717.95
8.1.00.0040.00417.84
8.0.300.0080.00018.77
8.0.290.0000.00917.25
8.0.280.0020.00518.80
8.0.270.0080.00017.72
8.0.260.0000.00717.29
8.0.250.0000.00817.48
8.0.240.0040.00417.45
8.0.230.0000.00817.43
8.0.220.0120.00017.39
8.0.210.0040.00417.30
8.0.200.0030.00317.39
8.0.190.0000.00817.45
8.0.180.0040.00417.33
8.0.170.0030.00617.33
8.0.160.0040.00417.46
8.0.150.0040.00417.30
8.0.140.0030.00617.32
8.0.130.0000.00613.98
8.0.120.0000.01017.39
8.0.110.0000.00817.48
8.0.100.0040.00417.42
8.0.90.0000.00817.42
8.0.80.0070.01117.48
8.0.70.0030.00517.39
8.0.60.0040.00417.45
8.0.50.0030.00617.43
8.0.30.0090.00917.73
8.0.20.0090.01217.65
8.0.10.0000.00817.45
8.0.00.0050.01517.32
7.4.330.0130.00214.02
7.4.320.0030.00317.10
7.4.300.0070.00017.07
7.4.290.0030.00317.04
7.4.280.0030.00716.87
7.4.270.0080.00017.05
7.4.260.0000.00613.86
7.4.250.0030.00617.23
7.4.240.0060.00317.21
7.4.230.0060.00317.08
7.4.220.0060.01917.09
7.4.210.0080.01117.11
7.4.200.0050.00516.99
7.4.190.0040.00417.18
7.4.160.0120.00417.25
7.4.150.0150.00416.98
7.4.140.0130.01017.86
7.4.130.0120.00916.98
7.4.120.0140.00817.18
7.4.110.0070.01117.20
7.4.100.0060.01217.09
7.4.90.0060.01917.13
7.4.80.0110.00719.39
7.4.70.0030.02116.97
7.4.60.0140.00417.01
7.4.50.0000.00817.18
7.4.40.0030.01617.05
7.4.30.0100.00717.18
7.4.00.0120.00515.61
7.3.330.0030.00313.88
7.3.320.0000.00713.64
7.3.310.0000.00817.01
7.3.300.0040.00416.84
7.3.290.0070.00916.86
7.3.280.0070.01416.68
7.3.270.0060.01216.75
7.3.260.0150.01116.89
7.3.240.0060.01216.86
7.3.230.0180.00317.09
7.3.210.0180.00717.02
7.3.200.0120.00617.03
7.3.190.0190.00417.08
7.3.180.0070.01316.93
7.3.170.0060.01216.83
7.3.160.0110.01117.08
7.3.120.0050.01315.54
7.3.110.0130.00715.52
7.3.100.0030.01015.58
7.3.90.0060.00915.48
7.3.80.0130.00015.38
7.3.70.0000.01015.14
7.3.60.0030.00915.40
7.3.50.0130.00015.38
7.3.40.0040.00715.24
7.3.30.0030.00915.05
7.3.20.0040.01217.20
7.3.10.0100.00617.23
7.3.00.0030.01016.98
7.2.330.0110.00717.04
7.2.320.0200.00717.04
7.2.310.0150.00417.09
7.2.300.0090.00916.99
7.2.290.0120.00816.97
7.2.250.0060.01515.64
7.2.240.0060.01215.63
7.2.230.0000.01115.49
7.2.220.0060.00615.29
7.2.210.0030.01315.51
7.2.200.0120.00315.38
7.2.190.0040.01115.63
7.2.180.0030.01415.65
7.2.170.0100.00315.27
7.2.60.0030.01017.44
7.2.00.0030.01020.00
7.1.330.0090.00916.40
7.1.320.0070.01016.25
7.1.310.0140.00016.25
7.1.300.0110.00416.46
7.1.290.0100.00316.05
7.1.280.0030.00716.32
7.1.270.0040.01116.30
7.1.260.0120.00315.91
7.1.200.0070.00716.43
7.1.100.0100.00618.69
7.1.70.0070.00417.73
7.1.60.0100.01619.21
7.1.50.0170.02434.96
7.1.00.0070.03022.67
7.0.200.0090.00017.06
7.0.140.0000.07722.39
7.0.120.0070.07022.33
7.0.60.0070.03322.05
7.0.50.0000.06318.26
7.0.40.0000.06020.59
7.0.30.0100.05020.48
7.0.20.0270.07020.54
7.0.10.0070.05320.45
7.0.00.0100.09020.46
5.6.280.0030.07321.30
5.6.210.0070.07320.82
5.6.200.0000.04718.60
5.6.190.0100.05720.97
5.6.180.1000.05321.13
5.6.170.0200.03720.88
5.6.160.0070.04720.88
5.6.150.0100.03718.54
5.6.140.0070.04018.65
5.6.130.0100.07718.66
5.6.120.0100.07721.41
5.6.110.0130.07721.53
5.6.100.0130.07721.43
5.6.90.0100.08321.29
5.6.80.0100.07020.73
5.5.350.0070.05720.71
5.5.340.0170.06318.46
5.5.330.0170.06020.86
5.5.320.0270.04320.63
5.5.310.0130.05020.60
5.5.300.0100.07718.37
5.5.290.0100.07318.37
5.5.280.0030.04321.11
5.5.270.0030.04321.21
5.5.260.0070.06321.27
5.5.250.0170.08320.84
5.5.240.0200.08020.39
5.4.450.0130.07320.09
5.4.440.0100.05319.89
5.4.430.0100.08020.08
5.4.420.0070.08319.95
5.4.410.0030.06719.76
5.4.400.0100.04019.72
5.4.390.0170.06319.72
5.4.380.0130.04019.71
5.4.370.0070.03719.84
5.4.360.0100.03019.72
5.4.350.0000.04019.57
5.4.340.0070.04319.61
5.4.320.0100.03319.69
5.4.310.0000.04019.75
5.4.300.0100.03019.73
5.4.290.0030.03719.61
5.4.280.0030.04019.48
5.4.270.0030.04019.72
5.4.260.0030.03719.52
5.4.250.0030.03719.75
5.4.240.0000.04019.63
5.4.230.0070.03319.75
5.4.220.0000.04019.71
5.4.210.0070.03719.64
5.4.200.0030.03719.80
5.4.190.0070.04019.77
5.4.180.0030.03719.65
5.4.170.0100.03319.48
5.4.160.0030.03719.79
5.4.150.0000.05019.79
5.4.140.0030.03717.11
5.4.130.0000.03716.92
5.4.120.0100.03017.08
5.4.110.0030.07717.13
5.4.100.0130.03717.23
5.4.90.0200.03317.15
5.4.80.0000.05717.07
5.4.70.0070.07017.17
5.4.60.0000.08316.96
5.4.50.0070.04717.19
5.4.40.0070.03716.97
5.4.30.0000.04016.88
5.4.20.0030.04317.00
5.4.10.0000.04016.96
5.4.00.0100.03716.35
5.3.290.0000.04015.09
5.3.280.0000.04014.94
5.3.270.0000.04015.12
5.3.260.0070.03315.09
5.3.250.0000.04715.10
5.3.240.0070.03315.11
5.3.230.0030.03714.92
5.3.220.0070.04015.05
5.3.210.0130.04715.08
5.3.200.0070.05715.08
5.3.190.0200.04714.98
5.3.180.0070.07015.01
5.3.170.0100.07315.02
5.3.160.0030.06315.04
5.3.150.0130.05714.89
5.3.140.0100.06315.04
5.3.130.0030.04014.98
5.3.120.0070.03715.07
5.3.110.0070.03715.02
5.3.100.0000.04714.50
5.3.90.0130.02714.36
5.3.80.0070.08014.52
5.3.70.0070.05314.48
5.3.60.0000.08014.50
5.3.50.0070.05014.26
5.3.40.0100.06714.43
5.3.30.0030.08014.32
5.3.20.0070.04014.12
5.3.10.0030.04714.15
5.3.00.0200.05013.97
5.2.170.0030.03711.60
5.2.160.0070.04011.48
5.2.150.0070.06711.60
5.2.140.0070.05711.58
5.2.130.0030.07011.54
5.2.120.0000.03311.42
5.2.110.0100.05311.42
5.2.100.0030.04011.40
5.2.90.0070.06011.48
5.2.80.0100.03711.56
5.2.70.0100.05011.39
5.2.60.0000.05011.37
5.2.50.0030.04711.33
5.2.40.0000.04711.43
5.2.30.0070.06011.34
5.2.20.0030.06311.41
5.2.10.0030.03711.17
5.2.00.0070.05311.15
5.1.60.0030.03710.46
5.1.50.0070.03010.32
5.1.40.0030.04310.44
5.1.30.0030.03310.80
5.1.20.0130.05310.68
5.1.10.0070.04010.42
5.1.00.0030.04010.42
5.0.50.0070.0279.09
5.0.40.0030.0278.92
5.0.30.0030.0678.62
5.0.20.0070.0278.61
5.0.10.0100.0338.59
5.0.00.0030.0608.47
4.4.90.0100.0178.08
4.4.80.0100.0308.08
4.4.70.0030.0208.08
4.4.60.0000.0408.08
4.4.50.0030.0178.08
4.4.40.0000.0608.08
4.4.30.0030.0378.08
4.4.20.0000.0408.08
4.4.10.0070.0238.08
4.4.00.0030.0278.08
4.3.110.0000.0378.08
4.3.100.0070.0238.08
4.3.90.0070.0308.08
4.3.80.0030.0508.08
4.3.70.0030.0208.08
4.3.60.0070.0278.08
4.3.50.0000.0338.08
4.3.40.0000.0508.08
4.3.30.0030.0308.08
4.3.20.0030.0378.08
4.3.10.0070.0208.08
4.3.00.0030.0338.08

preferences:
43.14 ms | 401 KiB | 5 Q