<?php
// Active assert and make it quiet
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_QUIET_EVAL, 1);
// 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 />";
}
// Set up the callback
assert_options(ASSERT_CALLBACK, 'my_assert_handler');
// Make an assertion that should fail
assert('mysql_query("")');
Deprecated: Constant ASSERT_ACTIVE is deprecated in /in/GJ8Hj on line 4
Deprecated: Function assert_options() is deprecated in /in/GJ8Hj on line 4
Deprecated: Constant ASSERT_WARNING is deprecated in /in/GJ8Hj on line 5
Deprecated: Function assert_options() is deprecated in /in/GJ8Hj on line 5
Fatal error: Uncaught Error: Undefined constant "ASSERT_QUIET_EVAL" in /in/GJ8Hj:6
Stack trace:
#0 {main}
thrown in /in/GJ8Hj on line 6
Process exited with code 255.
Fatal error: Uncaught Error: Undefined constant "ASSERT_QUIET_EVAL" in /in/GJ8Hj:6
Stack trace:
#0 {main}
thrown in /in/GJ8Hj on line 6
Process exited with code 255.
Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/GJ8Hj on line 21
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/GJ8Hj(21) : assert code:1
Stack trace:
#0 [internal function]: unknown()
#1 /in/GJ8Hj(21): assert('mysql_query("")')
#2 {main}
thrown in /in/GJ8Hj(21) : assert code on line 1
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/GJ8Hj(21) : assert code:1
Stack trace:
#0 [internal function]: unknown()
#1 /in/GJ8Hj(21): assert('mysql_query("")')
#2 {main}
thrown in /in/GJ8Hj(21) : assert code on line 1
Process exited with code 255.