3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $con = file_get_contents('http://botd.wordpress.com/topsites-ta.xml/');/* Feed Url */ $title = getlinks("<title>", "</title>", $con); // gets Title and stored in array $url = getlinks("<link>", "</link>", $con); // gets Url and stored in array echo "<ul>"; for($i=0; $i < 6; $i++) { echo '<li><a href="'.$url[$i].'" title="'.$title[$i].'" >'.urldecode($title[$i]).'</a></li>'; } echo "</ul>"; function getlinks($s1,$s2,$s) { $myarray=array(); $s1 = strtolower($s1); $s2 = strtolower($s2); $L1 = strlen($s1); $L2 = strlen($s2); $scheck=strtolower($s); do { $pos1 = strpos($scheck,$s1); if($pos1!==false) { $pos2 = strpos(substr($scheck,$pos1+$L1),$s2); if($pos2!==false) { $myarray[]=substr($s,$pos1+$L1,$pos2); $s=substr($s,$pos1+$L1+$pos2+$L2); $scheck=strtolower($s); } } } while (($pos1!==false)and($pos2!==false)); return $myarray; } ?>
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/h0VfS on line 3 Warning: file_get_contents(http://botd.wordpress.com/topsites-ta.xml/): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/h0VfS on line 3 <ul> Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li></ul>
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open http://botd.wordpress.com/topsites-ta.xml/ (Could not resolve host: botd.wordpress.com) in /in/h0VfS on line 3 <ul> Notice: Undefined index: 0 in /in/h0VfS on line 9 Notice: Undefined index: 0 in /in/h0VfS on line 9 Notice: Undefined index: 0 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined index: 1 in /in/h0VfS on line 9 Notice: Undefined index: 1 in /in/h0VfS on line 9 Notice: Undefined index: 1 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined index: 2 in /in/h0VfS on line 9 Notice: Undefined index: 2 in /in/h0VfS on line 9 Notice: Undefined index: 2 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined index: 3 in /in/h0VfS on line 9 Notice: Undefined index: 3 in /in/h0VfS on line 9 Notice: Undefined index: 3 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined index: 4 in /in/h0VfS on line 9 Notice: Undefined index: 4 in /in/h0VfS on line 9 Notice: Undefined index: 4 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li><li><a href="" title="" ></a></li></ul>
Output for 5.2.6 - 5.2.17
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/h0VfS on line 3 Warning: file_get_contents(http://botd.wordpress.com/topsites-ta.xml/): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/h0VfS on line 3 <ul> Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li></ul>
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.4.9, 5.0.3 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/h0VfS on line 3 Warning: file_get_contents(http://botd.wordpress.com/topsites-ta.xml/): failed to open stream: Connection refused in /in/h0VfS on line 3 <ul> Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li></ul>
Output for 4.3.5 - 4.3.9, 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/h0VfS on line 3 Warning: file_get_contents(http://botd.wordpress.com/topsites-ta.xml/): failed to open stream: Success in /in/h0VfS on line 3 <ul> Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li></ul>
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/h0VfS on line 3 Warning: file_get_contents(http://botd.wordpress.com/topsites-ta.xml/): failed to open stream: Bad file descriptor in /in/h0VfS on line 3 <ul> Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li></ul>
Output for 4.3.2
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/h0VfS on line 3 Warning: file_get_contents(http://botd.wordpress.com/topsites-ta.xml/): failed to open stream: Connection refused in /in/h0VfS on line 3 <ul> Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li></ul>
Output for 4.3.0 - 4.3.1
Warning: file_get_contents() [http://www.php.net/function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/h0VfS on line 3 Warning: file_get_contents(http://botd.wordpress.com/topsites-ta.xml/) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/h0VfS on line 3 <ul> Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 Notice: Undefined offset: 0 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 Notice: Undefined offset: 1 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 Notice: Undefined offset: 2 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 Notice: Undefined offset: 3 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 Notice: Undefined offset: 4 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li> Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 Notice: Undefined offset: 5 in /in/h0VfS on line 9 <li><a href="" title="" ></a></li></ul>