3v4l.org

run code in 300+ PHP versions simultaneously
<?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 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/GoB7u:12 Stack trace: #0 {main} thrown in /in/GoB7u on line 12
Process exited with code 255.
Output for 8.0.13
Parse error: syntax error, unexpected identifier "version" in /in/GoB7u on line 16
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 7.3.32 - 7.3.33, 7.4.26, 7.4.33
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.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
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.3.11, 4.4.0 - 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>

preferences:
305.4 ms | 404 KiB | 456 Q