3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?Php require "config.php"; // Database connection $count="SELECT id,name, social, math, science, sum(social + math + science ) as total, sum(social + math + science )/3 as avg from student3 group by id"; echo "<table>"; echo "<tr><th>id</th><th>name</th><th>social</th><th>math</th><th>science</th><th>total</th><th>avg</th></tr>"; foreach ($dbo->query($count) as $row) { echo "<tr ><td>$row[id]</td><td>$row[name]</td><td>$row[social]</td><td>$row[math]</td><td>$row[science]</td><td>$row[total]</td><td>$row[avg]</td></tr>"; } echo "</table>"; ?>
based on Dr5Gu
Output for 5.1.0 - 7.1.0
Warning: require(config.php): failed to open stream: No such file or directory in /in/LNWto on line 2 Fatal error: require(): Failed opening required 'config.php' (include_path='.:') in /in/LNWto on line 2
Process exited with code 255.
Output for 4.3.2 - 5.0.5
Warning: main(config.php): failed to open stream: No such file or directory in /in/LNWto on line 2 Fatal error: main(): Failed opening required 'config.php' (include_path='.:') in /in/LNWto on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: main(config.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/LNWto on line 2 Fatal error: main() [http://www.php.net/function.main]: Failed opening required 'config.php' (include_path='.:') in /in/LNWto on line 2