3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $rss = simplexml_load_file('http://on-ze.com/feed'); echo '<ul>'; foreach($rss->channel->item as $item){ $title = $item->title; $date = date("Y年 n月 j日", strtotime($item->pubDate)); $link = $item->link; $description = mb_strimwidth (strip_tags($item->description), 0 , 110, "…Read More", "utf-8"); ?> <li><a href="<?php echo $link; ?>" target="_blank"> <span class="date"><?php echo $date; ?></span> <span class="title"><?php echo $title; ?></span> <span class="text"><?php echo $description; ?></span> </a></li> <?php } echo '</ul>'; ?>
Output for 7.2.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: System error in /in/7uoS8 on line 2 Warning: simplexml_load_file(http://on-ze.com/feed): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/7uoS8 on line 2 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://on-ze.com/feed" in /in/7uoS8 on line 2 <ul> Notice: Trying to get property 'channel' of non-object in /in/7uoS8 on line 4 Notice: Trying to get property 'item' of non-object in /in/7uoS8 on line 4 Warning: Invalid argument supplied for foreach() in /in/7uoS8 on line 4 </ul>
Output for 7.0.20, 7.1.5 - 7.1.10
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: System error in /in/7uoS8 on line 2 Warning: simplexml_load_file(http://on-ze.com/feed): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/7uoS8 on line 2 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://on-ze.com/feed" in /in/7uoS8 on line 2 <ul> Notice: Trying to get property of non-object in /in/7uoS8 on line 4 Notice: Trying to get property of non-object in /in/7uoS8 on line 4 Warning: Invalid argument supplied for foreach() in /in/7uoS8 on line 4 </ul>
Output for 5.5.0 - 7.0.10, 7.1.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7uoS8 on line 2 Warning: simplexml_load_file(http://on-ze.com/feed): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7uoS8 on line 2 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://on-ze.com/feed" in /in/7uoS8 on line 2 <ul> Notice: Trying to get property of non-object in /in/7uoS8 on line 4 Notice: Trying to get property of non-object in /in/7uoS8 on line 4 Warning: Invalid argument supplied for foreach() in /in/7uoS8 on line 4 </ul>