3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Make sure SimplePie is included. You may need to change this to match the location of autoloader.php // For 1.0-1.2: #require_once('../simplepie.inc'); // For 1.3+: require_once __DIR__ . DIRECTORY_SEPARATOR . 'autoloader.php'; // We'll process this feed with all of the default options. $feed = new SimplePie(); // Set which feed to process. // Single feed $feed = new SimplePie(); $feed->set_feed_url(array('http://www.corex-fitness.com/blog/feed/')); $feed->enable_order_by_date(false); //$feed->set_cache_location(basename(__DIR__) . '/cache'); $feed->init(); // Run SimplePie. $feed->init(); // This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it). $feed->handle_content_type(); // Let's begin our XHTML webpage code. The DOCTYPE is supposed to be the very first thing, so we'll keep it on the same line as the closing-PHP tag. //Shorten the description. function shorten($string, $length) { // By default, an ellipsis will be appended to the end of the text. $suffix = '&hellip;'; // Convert 'smart' punctuation to 'dumb' punctuation, strip the HTML tags, // and convert all tabs and line-break characters to single spaces. $short_desc = trim(str_replace(array("\r","\n", "\t"), ' ', strip_tags($string))); // Cut the string to the requested length, and strip any extraneous spaces // from the beginning and end. $desc = trim(substr($short_desc, 0, $length)); // Find out what the last displayed character is in the shortened string $lastchar = substr($desc, -1, 1); // If the last character is a period, an exclamation point, or a question // mark, clear out the appended text. if ($lastchar == '.' || $lastchar == '!' || $lastchar == '?') $suffix=''; // Append the text. $desc .= $suffix; // Send the new description back to the page. return $desc; } function get_first_image_url($html) { if (preg_match('/<img.+?src="(.+?)"/', $html, $matches)) { return $matches[1]; } //else return 'url_of_default_image_if_post_has_no_img_tags.jpg'; } ?> <?php /* Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop. */ foreach ($feed->get_items(0, 1) as $item): ?> <div class=" col-1"> <div class="block block-list"> <div class="block-title"><strong> <span>Blog</span> </strong></div> <div class="block-content"><?php echo '<img src="' .get_first_image_url($item->get_content()). '"/>'; ?> <div class="content-title"><a href="<?php echo $item->get_permalink(); ?>" target="_blank"><?php echo $item->get_title(); ?></a></div> <p><?php echo shorten($item->get_description(), 150); ?></p> <p>Written on <?php echo $item->get_date('jS F Y'); ?></p> <p><a href="<?php echo $item->get_permalink(); ?>" target="_blank">Read More</a></p> </div> </div> </div> <?php endforeach; ?>

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.0100.00716.63
8.3.50.0090.00721.92
8.3.40.0040.01118.87
8.3.30.0110.00419.21
8.3.20.0070.00020.34
8.3.10.0060.00323.65
8.3.00.0040.00420.82
8.2.180.0120.00316.74
8.2.170.0070.00722.96
8.2.160.0140.00020.52
8.2.150.0030.00624.18
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0000.00820.82
8.2.110.0060.00322.25
8.2.100.0090.00317.97
8.2.90.0040.00419.02
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0070.00317.80
8.2.50.0060.00318.07
8.2.40.0050.00318.03
8.2.30.0040.00418.41
8.2.20.0090.00017.82
8.2.10.0030.00518.14
8.2.00.0000.00817.87
8.1.280.0120.00425.92
8.1.270.0040.00422.01
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0000.00824.02
8.1.230.0030.01019.26
8.1.220.0040.00417.76
8.1.210.0050.00318.77
8.1.200.0070.00317.35
8.1.190.0000.00917.48
8.1.180.0050.00318.10
8.1.170.0080.00018.79
8.1.160.0040.00422.07
8.1.150.0040.00418.65
8.1.140.0000.00717.52
8.1.130.0030.00317.88
8.1.120.0030.00317.50
8.1.110.0000.00717.37
8.1.100.0000.00717.48
8.1.90.0000.00717.32
8.1.80.0000.00717.43
8.1.70.0000.00717.43
8.1.60.0000.00917.66
8.1.50.0030.00617.63
8.1.40.0030.00617.61
8.1.30.0050.00317.55
8.1.20.0000.00817.68
8.1.10.0040.00417.54
8.1.00.0040.00417.61
8.0.300.0050.00219.75
8.0.290.0000.00817.00
8.0.280.0000.00718.46
8.0.270.0070.00017.39
8.0.260.0030.00317.39
8.0.250.0070.00017.17
8.0.240.0030.00317.15
8.0.230.0000.00717.14
8.0.220.0000.00717.05
8.0.210.0000.00717.11
8.0.200.0000.00617.02
8.0.190.0070.00017.17
8.0.180.0060.00317.10
8.0.170.0030.00517.13
8.0.160.0000.00717.02
8.0.150.0070.00316.99
8.0.140.0000.00817.01
8.0.130.0000.00613.53
8.0.120.0000.00717.04
8.0.110.0040.00417.12
8.0.100.0040.00416.92
8.0.90.0040.00416.97
8.0.80.0030.01217.07
8.0.70.0040.00417.08
8.0.60.0070.00017.00
8.0.50.0040.00417.08
8.0.30.0110.01117.03
8.0.20.0130.00517.40
8.0.10.0050.00217.08
8.0.00.0100.00817.00
7.4.330.0050.00015.08
7.4.320.0060.00016.72
7.4.300.0030.00316.67
7.4.290.0050.00216.50
7.4.280.0050.00316.48
7.4.270.0020.00516.60
7.4.260.0070.00416.58
7.4.250.0070.00016.64
7.4.240.0050.00216.54
7.4.230.0000.00716.70
7.4.220.0060.01316.60
7.4.210.0070.00716.67
7.4.200.0040.00416.75
7.4.160.0070.01516.46
7.4.150.0150.00317.40
7.4.140.0120.00517.86
7.4.130.0080.01316.68
7.4.120.0110.00616.48
7.4.110.0070.01016.54
7.4.100.0130.01216.36
7.4.90.0060.01216.63
7.4.80.0150.00419.39
7.4.70.0070.01716.68
7.4.60.0110.00616.76
7.4.50.0060.00316.60
7.4.40.0090.00616.61
7.4.30.0060.00916.67
7.4.00.0090.00614.87
7.3.330.0000.00513.31
7.3.320.0000.00513.31
7.3.310.0080.00016.36
7.3.300.0030.00316.39
7.3.290.0070.00716.36
7.3.280.0090.00916.40
7.3.270.0070.01117.40
7.3.260.0210.00716.43
7.3.250.0070.01016.61
7.3.240.0070.01116.35
7.3.230.0060.01216.39
7.3.210.0190.00316.45
7.3.200.0160.00919.39
7.3.190.0100.00716.61
7.3.180.0060.01116.38
7.3.170.0100.00616.39
7.3.160.0090.00616.45
7.3.120.0030.01214.78
7.3.110.0140.00714.98
7.3.100.0060.00914.47
7.3.90.0040.00714.87
7.3.80.0060.00614.83
7.3.70.0080.00814.60
7.3.60.0030.01014.64
7.3.50.0070.00414.64
7.3.40.0040.00714.80
7.3.30.0070.00314.93
7.3.20.0100.00316.33
7.3.10.0030.01016.47
7.3.00.0030.00816.60
7.2.330.0090.00916.47
7.2.320.0060.01016.62
7.2.310.0110.00616.50
7.2.300.0120.00316.60
7.2.290.0100.00716.44
7.2.250.0120.00415.07
7.2.240.0100.01314.71
7.2.230.0030.01315.06
7.2.220.0060.00915.22
7.2.210.0090.00614.95
7.2.200.0070.00415.04
7.2.190.0030.01015.05
7.2.180.0070.00714.86
7.2.170.0000.01314.56
7.2.130.0000.01016.66
7.2.120.0090.00616.93
7.2.110.0050.00516.75
7.2.100.0080.00416.93
7.2.90.0030.00716.45
7.2.80.0060.00317.01
7.2.70.0040.00817.03
7.2.60.0070.00316.74
7.2.50.0040.00416.76
7.2.40.0000.01516.79
7.2.30.0030.00616.68
7.2.20.0070.00716.68
7.2.10.0080.00816.66
7.2.00.0090.00317.84
7.1.330.0000.01315.57
7.1.320.0030.00515.65
7.1.310.0000.01115.80
7.1.300.0030.00715.69
7.1.290.0000.01215.32
7.1.280.0140.00015.69
7.1.270.0030.00715.82
7.1.260.0000.01315.35
7.1.250.0000.01115.62
7.1.200.0140.00015.77
7.1.100.0030.00617.71
7.1.70.0000.00717.08
7.1.60.0060.01919.70
7.1.50.0070.01716.60
7.1.00.0030.07722.46
7.0.200.0000.00916.26
7.0.140.0070.07022.00
7.0.60.0030.07019.86
7.0.50.0030.04317.90
7.0.40.0070.04020.40
7.0.30.0170.04320.09
7.0.20.0200.04320.21
7.0.10.0300.07720.09
7.0.00.0000.04320.36
5.6.210.0170.06320.55
5.6.200.0030.04318.25
5.6.190.0100.04320.68
5.6.180.0200.04020.46
5.6.170.0270.08320.48
5.6.160.0130.07020.56
5.6.150.0070.06018.17
5.6.140.0000.05018.24
5.6.130.0070.06318.25
5.6.120.0100.07321.04
5.6.110.0100.08021.01
5.6.100.0170.06721.00
5.6.90.0070.08721.10
5.6.80.0070.08320.57
5.6.70.0200.07320.38
5.5.350.0130.07020.31
5.5.340.0000.04718.00
5.5.330.0100.05020.41
5.5.320.0200.04020.28
5.5.310.0230.05320.42
5.5.300.0100.08018.07
5.5.290.0100.08717.96
5.5.280.0130.08020.81
5.5.270.0070.08320.86
5.5.260.0100.08320.91
5.5.250.0070.05720.60
5.5.240.0100.06020.20
5.4.450.3500.05019.56
5.4.440.3400.03719.30
5.4.430.3230.03719.34
5.4.420.3770.03319.39
5.4.410.3670.03319.33
5.4.400.3600.03719.18
5.4.390.3400.03019.18
5.4.380.3830.03319.00
5.4.370.4130.04319.23
5.4.360.4300.03718.88
5.4.350.3670.04019.18
5.4.340.3370.04319.15
5.4.320.3370.03718.88
5.4.310.3700.03719.32
5.4.300.4070.04319.15
5.4.290.3570.04319.06
5.4.280.3500.04019.22
5.4.270.3700.03319.10
5.4.260.3130.03718.88
5.4.250.3830.04318.99
5.4.240.3700.03719.09
5.4.230.3770.03319.21
5.4.220.4600.03718.91
5.4.210.3630.04018.99
5.4.200.3700.03719.19
5.4.190.3530.04019.17
5.4.180.3670.04319.24
5.4.170.3500.03719.15
5.4.160.3570.03719.07
5.4.150.3570.04018.86
5.4.140.3300.04016.46
5.4.130.4200.03316.42
5.4.120.3800.03716.36
5.4.110.4000.03716.46
5.4.100.3600.03716.32
5.4.90.3530.03716.59
5.4.80.3630.04016.31
5.4.70.3330.03716.23
5.4.60.3730.04016.55
5.4.50.3900.03716.59
5.4.40.4330.03716.53
5.4.30.4070.04016.18
5.4.20.3470.02716.52
5.4.10.3600.04016.43
5.4.00.3800.04015.77
5.3.290.3570.04014.61
5.3.280.3630.03714.52
5.3.270.3770.03314.85
5.3.260.3030.03314.61
5.3.250.3570.03714.55
5.3.240.4230.03714.53
5.3.230.3600.04314.53
5.3.220.3530.04014.50
5.3.210.3670.03714.64
5.3.200.3700.03314.56
5.3.190.3730.03314.52
5.3.180.3100.03714.66
5.3.170.3670.03314.70
5.3.160.3570.03714.81
5.3.150.3700.03314.60
5.3.140.4200.04014.48
5.3.130.3700.03714.50
5.3.120.3670.04014.57
5.3.110.3870.04314.48
5.3.100.3630.03713.98
5.3.90.3330.04013.95
5.3.80.3870.02314.12
5.3.70.3370.03314.04
5.3.60.3630.03714.07
5.3.50.3630.04314.05
5.3.40.3400.03714.02
5.3.30.3370.03313.94
5.3.20.3470.03313.71
5.3.10.3000.03313.76
5.3.00.3730.03713.79
5.2.170.3130.02711.15
5.2.160.2530.03011.14
5.2.150.2800.03011.29
5.2.140.2700.02311.21
5.2.130.2800.03011.30
5.2.120.2870.03311.08
5.2.110.2130.03011.03
5.2.100.3030.02311.06
5.2.90.2830.02311.05
5.2.80.2900.02711.23
5.2.70.2830.03011.23
5.2.60.2800.03011.00
5.2.50.2470.02710.96
5.2.40.2030.03011.15
5.2.30.2400.02010.90
5.2.20.2370.03011.21
5.2.10.2470.02010.89
5.2.00.2500.02310.92
5.1.60.2570.02010.62
5.1.50.2270.02010.62
5.1.40.2730.01710.62
5.1.30.2600.02710.62
5.1.20.1970.02710.62
5.1.10.2570.02710.62
5.1.00.2670.03710.62
5.0.50.1330.01710.62
5.0.40.1700.02310.62
5.0.30.1730.03710.62
5.0.20.1700.01710.62
5.0.10.1430.01710.62
5.0.00.1400.03010.62
4.4.90.1270.01710.62
4.4.80.1100.01710.62
4.4.70.1200.01010.62
4.4.60.1370.01710.62
4.4.50.1470.02010.62
4.4.40.1100.02710.62
4.4.30.1470.02010.62
4.4.20.1330.01310.62
4.4.10.1300.02010.62
4.4.00.1630.02710.62
4.3.110.1630.01710.62
4.3.100.1430.01310.62
4.3.90.1670.01710.62
4.3.80.1570.02310.62
4.3.70.1600.01310.62
4.3.60.1670.01310.62
4.3.50.1730.01010.62
4.3.40.1670.02310.62
4.3.30.0830.02010.62
4.3.20.0930.02010.62
4.3.10.0770.01310.62
4.3.00.0730.01310.62

preferences:
41.82 ms | 401 KiB | 5 Q