3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Create a handler function function my_assert_handler($file, $line, $code) { echo "<hr>Assertion Failed: File '$file'<br /> Line '$line'<br /> Code '$code'<br /><hr />"; exit; } // Set up the callback assert_options(ASSERT_CALLBACK, 'my_assert_handler'); // Make an assertion that should fail assert('mysql_query("")');
Output for 7.0.0 - 7.1.0
Warning: assert(): Assertion "mysql_query("")" failed in /in/YeQXD on line 18 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/YeQXD(18) : assert code:1 Stack trace: #0 [internal function]: unknown() #1 /in/YeQXD(18): assert('mysql_query("")') #2 {main} thrown in /in/YeQXD(18) : assert code on line 1
Process exited with code 255.
Output for hhvm-3.12.0
Warning: supplied argument is not a valid MySQL-Link resource <hr>Assertion Failed: File '/in/YeQXD'<br /> Line '18'<br /> Code 'mysql_query("")'<br /><hr />
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_query() in /in/YeQXD(18) : assert code on line 1
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/YeQXD(18) : assert code on line 1 Warning: mysql_query(): A link to the server could not be established in /in/YeQXD(18) : assert code on line 1 <hr>Assertion Failed: File '/in/YeQXD'<br /> Line '18'<br /> Code 'mysql_query("")'<br /><hr />
Output for 4.3.0 - 4.3.1
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/YeQXD(18) : assert code on line 1 Warning: mysql_query() [http://www.php.net/function.mysql-query]: A link to the server could not be established in /in/YeQXD(18) : assert code on line 1 <hr>Assertion Failed: File '/in/YeQXD'<br /> Line '18'<br /> Code 'mysql_query("")'<br /><hr />