3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Brings in some Joomla Framework features to allow databse handling below define( '_JEXEC', 1 ); define( 'JPATH_BASE', realpath(dirname(__FILE__))); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); $mainframe =& JFactory::getApplication('site'); $mainframe->initialise(); ob_start(); echo "<?xml version='1.0' encoding='UTF-8'?> <urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>"; $db = JFactory::getDbo(); $query = "SELECT * FROM #__sh404sef_urls ORDER BY oldurl ASC"; $db->setQuery($query); $rows = $db->loadObjectList(); foreach ($rows as $row) { $SEFedurl = $row->oldurl; $date = date("Y-m-d"); $line = "<url> <loc>http://" . $_SERVER['HTTP_HOST'] . "/$SEFedurl</loc> <priority>1.00</priority> <changefreq>weekly</changefreq> <lastmod>$date</lastmod> </url>"; echo $line; } echo "</urlset>"; //mysqli_close($dbc); $toWrite = ob_get_clean(); $toWrite; // data generated from form, formatted to XML $fp = fopen('sitemap.xml', 'w'); fwrite($fp, $toWrite); fclose($fp); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Warning: require_once(/in/includes/defines.php): Failed to open stream: No such file or directory in /in/rHfX6 on line 8 Fatal error: Uncaught Error: Failed opening required '/in/includes/defines.php' (include_path='.:') in /in/rHfX6:8 Stack trace: #0 {main} thrown in /in/rHfX6 on line 8
Process exited with code 255.
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: require_once(/in/includes/defines.php): failed to open stream: No such file or directory in /in/rHfX6 on line 8 Fatal error: require_once(): Failed opening required '/in/includes/defines.php' (include_path='.:') in /in/rHfX6 on line 8
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: require_once(/in/includes/defines.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>/in/rHfX6</b> on line <b>8</b><br /> <br /> <b>Fatal error</b>: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/in/includes/defines.php' (include_path='.:') in <b>/in/rHfX6</b> on line <b>8</b><br />
Process exited with code 255.
Output for 4.4.3 - 4.4.9, 5.0.0 - 5.0.5
<br /> <b>Warning</b>: main(/in/includes/defines.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in <b>/in/rHfX6</b> on line <b>8</b><br /> <br /> <b>Fatal error</b>: main() [<a href='function.require'>function.require</a>]: Failed opening required '/in/includes/defines.php' (include_path='.:') in <b>/in/rHfX6</b> on line <b>8</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.2
<br /> <b>Warning</b>: main(/in/includes/defines.php): failed to open stream: No such file or directory in <b>/in/rHfX6</b> on line <b>8</b><br /> <br /> <b>Fatal error</b>: main(): Failed opening required '/in/includes/defines.php' (include_path='.:') in <b>/in/rHfX6</b> on line <b>8</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: main(/in/includes/defines.php) [<a href='http://www.php.net/function.main'>function.main</a>]: failed to create stream: No such file or directory in <b>/in/rHfX6</b> on line <b>8</b><br /> <br /> <b>Fatal error</b>: main() [<a href='http://www.php.net/function.main'>function.main</a>]: Failed opening required '/in/includes/defines.php' (include_path='.:') in <b>/in/rHfX6</b> on line <b>8</b><br />

preferences:
269.62 ms | 402 KiB | 469 Q