3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Connect to DB mysql_connect(NEW_DB_HOST, NEW_DB_USER, NEW_DB_PASS); mysql_select_db(NEW_DB_NAME); $searchstring = strtolower($request['term']); $project_state = $request['state']; if (0 == $project_state) { $project_state = ""; } else { $project_state = "AND b.project_state = ".(int)$project_state; } if ($is_controlling) { $filter = ''; } else { $filter = "AND a.employees_id = ".(int)$user_id; }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/k9Smp:4 Stack trace: #0 {main} thrown in /in/k9Smp on line 4
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/k9Smp on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Use of undefined constant NEW_DB_HOST - assumed 'NEW_DB_HOST' in /in/k9Smp on line 4 Notice: Use of undefined constant NEW_DB_USER - assumed 'NEW_DB_USER' in /in/k9Smp on line 4 Notice: Use of undefined constant NEW_DB_PASS - assumed 'NEW_DB_PASS' in /in/k9Smp on line 4 Warning: mysql_connect(): Unknown MySQL Server Host 'NEW_DB_HOST' (11) in /in/k9Smp on line 4 Notice: Use of undefined constant NEW_DB_NAME - assumed 'NEW_DB_NAME' in /in/k9Smp on line 5 Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/k9Smp on line 5 Warning: mysql_select_db(): A link to the server could not be established in /in/k9Smp on line 5 Notice: Undefined variable: request in /in/k9Smp on line 7 Notice: Undefined variable: request in /in/k9Smp on line 8 Notice: Undefined variable: is_controlling in /in/k9Smp on line 20 Notice: Undefined variable: user_id in /in/k9Smp on line 27
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant NEW_DB_HOST - assumed 'NEW_DB_HOST' in /in/k9Smp on line 4 Notice: Use of undefined constant NEW_DB_USER - assumed 'NEW_DB_USER' in /in/k9Smp on line 4 Notice: Use of undefined constant NEW_DB_PASS - assumed 'NEW_DB_PASS' in /in/k9Smp on line 4 Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Unknown MySQL Server Host 'NEW_DB_HOST' (11) in /in/k9Smp on line 4 Notice: Use of undefined constant NEW_DB_NAME - assumed 'NEW_DB_NAME' in /in/k9Smp on line 5 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/k9Smp on line 5 Warning: mysql_select_db() [http://www.php.net/function.mysql-select-db]: A link to the server could not be established in /in/k9Smp on line 5 Notice: Undefined variable: request in /in/k9Smp on line 7 Notice: Undefined variable: request in /in/k9Smp on line 8 Notice: Undefined variable: is_controlling in /in/k9Smp on line 20 Notice: Undefined variable: user_id in /in/k9Smp on line 27