3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php include 'include.php'; mysql_connect($mysql_host, $mysql_username, $mysql_password) or die(__LINE__ . ' Invalid connect: ' . mysql_error()); mysql_select_db($mysql_database) or die( "Unable to select database. Run setup first."); $sum = 0.00; $result = mysql_query("select value from invoice_payments where value >= 0.01"); if(!$result) die(__LINE__ . mysql_error()); while($row = mysql_fetch_array($result)) { $sum += 0.01; } $sum *= .90; echo (string)$sum; //echo $sum;
Output for 7.0.0 - 7.1.0
Warning: include(include.php): failed to open stream: No such file or directory in /in/g6pv9 on line 3 Warning: include(): Failed opening 'include.php' for inclusion (include_path='.:') in /in/g6pv9 on line 3 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/g6pv9:4 Stack trace: #0 {main} thrown in /in/g6pv9 on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: File not found: include.php in /in/g6pv9 on line 3 Notice: Undefined variable: mysql_host in /in/g6pv9 on line 4 Notice: Undefined variable: mysql_username in /in/g6pv9 on line 4 Notice: Undefined variable: mysql_password in /in/g6pv9 on line 4 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/g6pv9 on line 4 4 Invalid connect: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
Output for 5.1.1 - 5.6.28
Warning: include(include.php): failed to open stream: No such file or directory in /in/g6pv9 on line 3 Warning: include(): Failed opening 'include.php' for inclusion (include_path='.:') in /in/g6pv9 on line 3 Fatal error: Call to undefined function mysql_connect() in /in/g6pv9 on line 4
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/g6pv9 on line 19
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: main(include.php): failed to open stream: No such file or directory in /in/g6pv9 on line 3 Warning: main(): Failed opening 'include.php' for inclusion (include_path='.:') in /in/g6pv9 on line 3 Fatal error: Call to undefined function mysql_connect() in /in/g6pv9 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: main(include.php): failed to open stream: No such file or directory in /in/g6pv9 on line 3 Warning: main(): Failed opening 'include.php' for inclusion (include_path='.:') in /in/g6pv9 on line 3 Notice: Undefined variable: mysql_host in /in/g6pv9 on line 4 Notice: Undefined variable: mysql_username in /in/g6pv9 on line 4 Notice: Undefined variable: mysql_password in /in/g6pv9 on line 4 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/g6pv9 on line 4 4 Invalid connect: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Output for 4.3.0 - 4.3.1
Warning: main(include.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/g6pv9 on line 3 Warning: main() [http://www.php.net/function.main]: Failed opening 'include.php' for inclusion (include_path='.:') in /in/g6pv9 on line 3 Notice: Undefined variable: mysql_host in /in/g6pv9 on line 4 Notice: Undefined variable: mysql_username in /in/g6pv9 on line 4 Notice: Undefined variable: mysql_password in /in/g6pv9 on line 4 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/g6pv9 on line 4 4 Invalid connect: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)