3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Get RSS Feed(s) // Get a SimplePie feed object from the specified feed source. $rss = fetch_feed( 'http://applythis.net/RaynerPersonnel/Search/rss/All/1' ); $maxitems = 0; if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly // Figure out how many total items there are, but limit it to 4. $maxitems = $rss->get_item_quantity( 4 ); // Build an array of all the items, starting with element 0 (first element). $rss_items = $rss->get_items( 0, $maxitems ); endif; ?> <div class="nJobs-container Jobs-container--alt"> <?php if ( $maxitems == 0 ) : ?> <span><?php _e( 'No items', 'my-text-domain' ); ?></span> <?php else : ?> <?php // Loop through each feed item and display each item as a hyperlink. ?> <?php foreach ( $rss_items as $item ) : ?> <a href="<?php echo esc_url( $item->get_link() ); ?>" title="rss feed" class="nJobs-job"> <span class="Jobs-role"><?php echo esc_html( $item->get_title() ); ?></span> <span class="Jobs-readmore Button">More info</span> </a> <?php endforeach; ?> <?php endif; ?> </div>
Output for 7.0.0 - 7.0.32, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Call to undefined function fetch_feed() in /in/8BXhg:4 Stack trace: #0 {main} thrown in /in/8BXhg on line 4
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Call to undefined function fetch_feed() in /in/8BXhg:4 Stack trace: #0 {main} thrown in /in/8BXhg on line 4
Process exited with code 255.
Output for 5.6.38
Fatal error: Call to undefined function fetch_feed() in /in/8BXhg on line 4
Process exited with code 255.

preferences:
192.06 ms | 401 KiB | 242 Q