3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php header('Content-Type: application/xml; charset=utf-8'); //db info $host="localhost"; // Host name $username="mynob"; // username $password="u5"; // password $db_name="my"; // Database name $tbl="sc-urls"; mysql_connect("$host", "$username", "$password"); mysql_select_db("$db_name"); ?> <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <!-- Sitemap SoundCloud Downloader--> <?php $q1=mysql_query("SELECT * FROM `$tbl`"); while($r=mysql_fetch_array($q1)){ $url=$r['url']; echo "<url> <loc>http://www.mynoblecare.com/$url</loc> <changefreq>daily</changefreq> <priority>1.00</priority> </url>"; } ?> </urlset>
Output for 5.4.0 - 5.5.8
Parse error: syntax error, unexpected 'version' (T_STRING) in /in/GoB7u on line 16
Process exited with code 255.
Output for 5.0.0 - 5.3.28
Fatal error: Call to undefined function mysql_connect() in /in/GoB7u on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/GoB7u on line 12 Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/GoB7u on line 13 Warning: mysql_select_db(): A link to the server could not be established in /in/GoB7u on line 13 <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <!-- Sitemap SoundCloud Downloader--> Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/GoB7u on line 24 Warning: mysql_query(): A link to the server could not be established in /in/GoB7u on line 24 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /in/GoB7u on line 25 </urlset>
Output for 4.3.0 - 4.3.1
Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/GoB7u on line 12 Warning: mysql_select_db() [http://www.php.net/function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/GoB7u on line 13 Warning: mysql_select_db() [http://www.php.net/function.mysql-select-db]: A link to the server could not be established in /in/GoB7u on line 13 <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <!-- Sitemap SoundCloud Downloader--> Warning: mysql_query() [http://www.php.net/function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/GoB7u on line 24 Warning: mysql_query() [http://www.php.net/function.mysql-query]: A link to the server could not be established in /in/GoB7u on line 24 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /in/GoB7u on line 25 </urlset>