3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> <?php $url = "http://thecatapi.com/api/images/get?format=xml&results_per_page=1"; $xml = simplexml_load_file($url); $xmlImg = $xml->data->images->image->url; $xmlImgSource = $xml->data->images->image->source_url; $source = $xmlImgsource; echo " <img src='$xmlImg' width='600px' class='img-thumbnail'> " ?> <br> <br> <div> <a href=" <?php echo $xmlImgSource ?> "> <button class="button"> Source </button> </a> <a href="/"> <button type="submit" class="button"> New Picture </button> </a> </div> <br> <p> Original made by Nihad Dizdarevic <br> TheCatAPI & XML </p> <a href="https://github.com/dizzyniho/TheCatsSite"> Fork this on GitHub </a> </center> </body> </html>
Output for 5.2.6 - 5.4.35, 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.1.0
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/K10dE on line 169 Warning: simplexml_load_file(http://thecatapi.com/api/images/get?format=xml&results_per_page=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/K10dE on line 169 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://thecatapi.com/api/images/get?format=xml&results_per_page=1" in /in/K10dE on line 169 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Undefined variable: xmlImgsource in /in/K10dE on line 181 <img src='' width='600px' class='img-thumbnail'> <br> <br> <div> <a href=" "> <button class="button"> Source </button> </a> <a href="/"> <button type="submit" class="button"> New Picture </button> </a> </div> <br> <p> Original made by Nihad Dizdarevic <br> TheCatAPI & XML </p> <a href="https://github.com/dizzyniho/TheCatsSite"> Fork this on GitHub </a> </center> </body> </html>
Output for 5.4.36 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: System error in /in/K10dE on line 169 Warning: simplexml_load_file(http://thecatapi.com/api/images/get?format=xml&results_per_page=1): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/K10dE on line 169 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://thecatapi.com/api/images/get?format=xml&results_per_page=1" in /in/K10dE on line 169 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Undefined variable: xmlImgsource in /in/K10dE on line 181 <img src='' width='600px' class='img-thumbnail'> <br> <br> <div> <a href=" "> <button class="button"> Source </button> </a> <a href="/"> <button type="submit" class="button"> New Picture </button> </a> </div> <br> <p> Original made by Nihad Dizdarevic <br> TheCatAPI & XML </p> <a href="https://github.com/dizzyniho/TheCatsSite"> Fork this on GitHub </a> </center> </body> </html>
Output for 5.1.0 - 5.2.5
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/K10dE on line 169 Warning: simplexml_load_file(http://thecatapi.com/api/images/get?format=xml&results_per_page=1): failed to open stream: Connection refused in /in/K10dE on line 169 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://thecatapi.com/api/images/get?format=xml&results_per_page=1" in /in/K10dE on line 169 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Undefined variable: xmlImgsource in /in/K10dE on line 181 <img src='' width='600px' class='img-thumbnail'> <br> <br> <div> <a href=" "> <button class="button"> Source </button> </a> <a href="/"> <button type="submit" class="button"> New Picture </button> </a> </div> <br> <p> Original made by Nihad Dizdarevic <br> TheCatAPI & XML </p> <a href="https://github.com/dizzyniho/TheCatsSite"> Fork this on GitHub </a> </center> </body> </html>
Output for 5.0.4 - 5.0.5
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/K10dE on line 169 Warning: simplexml_load_file(http://thecatapi.com/api/images/get?format=xml&results_per_page=1): failed to open stream: Connection refused in /in/K10dE on line 169 Warning: connection refusedI/O warning : failed to load external entity "http://thecatapi.com/api/images/get?format=xml&results_per_page=1" in /in/K10dE on line 169 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Undefined variable: xmlImgsource in /in/K10dE on line 181 <img src='' width='600px' class='img-thumbnail'> <br> <br> <div> <a href=" "> <button class="button"> Source </button> </a> <a href="/"> <button type="submit" class="button"> New Picture </button> </a> </div> <br> <p> Original made by Nihad Dizdarevic <br> TheCatAPI & XML </p> <a href="https://github.com/dizzyniho/TheCatsSite"> Fork this on GitHub </a> </center> </body> </html>
Output for 5.0.3
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/K10dE on line 169 Warning: simplexml_load_file(http://thecatapi.com/api/images/get?format=xml&results_per_page=1): failed to open stream: Connection refused in /in/K10dE on line 169 Warning: connection refusedI/O warning : failed to load external entity "http://thecatapi.com/api/images/get?format=xml&results_per_page=1" in /in/K10dE on line 169 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Undefined variable: xmlImgsource in /in/K10dE on line 181 <img src='' width='600px' class='img-thumbnail'> <br> <br> <div> <a href=" "> <button class="button"> Source </button> </a> <a href="/"> <button type="submit" class="button"> New Picture </button> </a> </div> <br> <p> Original made by Nihad Dizdarevic <br> TheCatAPI & XML </p> <a href="https://github.com/dizzyniho/TheCatsSite"> Fork this on GitHub </a> </center> </body> </html>
Output for 5.0.1 - 5.0.2
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Warning: simplexml_load_file(): php_network_getaddresses: gethostbyname failed in /in/K10dE on line 169 Warning: simplexml_load_file(http://thecatapi.com/api/images/get?format=xml&results_per_page=1): failed to open stream: Success in /in/K10dE on line 169 Warning: connection refusedI/O warning : failed to load external entity "http://thecatapi.com/api/images/get?format=xml&results_per_page=1" in /in/K10dE on line 169 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Undefined variable: xmlImgsource in /in/K10dE on line 181 <img src='' width='600px' class='img-thumbnail'> <br> <br> <div> <a href=" "> <button class="button"> Source </button> </a> <a href="/"> <button type="submit" class="button"> New Picture </button> </a> </div> <br> <p> Original made by Nihad Dizdarevic <br> TheCatAPI & XML </p> <a href="https://github.com/dizzyniho/TheCatsSite"> Fork this on GitHub </a> </center> </body> </html>
Output for 5.0.0
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Warning: simplexml_load_file(): php_network_getaddresses: gethostbyname failed in /in/K10dE on line 169 Warning: simplexml_load_file(http://thecatapi.com/api/images/get?format=xml&results_per_page=1): failed to open stream: Bad file descriptor in /in/K10dE on line 169 Warning: connection refusedI/O warning : failed to load external entity "http://thecatapi.com/api/images/get?format=xml&results_per_page=1" in /in/K10dE on line 169 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 173 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Trying to get property of non-object in /in/K10dE on line 177 Notice: Undefined variable: xmlImgsource in /in/K10dE on line 181 <img src='' width='600px' class='img-thumbnail'> <br> <br> <div> <a href=" "> <button class="button"> Source </button> </a> <a href="/"> <button type="submit" class="button"> New Picture </button> </a> </div> <br> <p> Original made by Nihad Dizdarevic <br> TheCatAPI & XML </p> <a href="https://github.com/dizzyniho/TheCatsSite"> Fork this on GitHub </a> </center> </body> </html>
Output for 4.4.5 - 4.4.9
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Fatal error: Call to undefined function: simplexml_load_file() in /in/K10dE on line 169
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Fatal error: Call to undefined function: simplexml_load_file() in /in/K10dE on line 169
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<html> <head> <style> body{ background-color: #95a5a6; } </style> <title> Random Cats </title> <meta charset="utf-8" /> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> </script> <style> body{ background-color: #95a5a6; }.img-thumbnail{ -moz-box-shadow: 3px 3px 5px 6px grey; -webkit-box-shadow: 3px 3px 5px 6px grey; box-shadow: 3px 3px 5px 6px grey; } </style> </head> <body> <center> <h1> Random Cats *.* </h1> Fatal error: Call to undefined function: simplexml_load_file() in /in/K10dE on line 169