2 Sybase-CT server message handler
4 <?php require('skipif.inc'); ?>
7 /* This file is part of PHP test framework for ext/sybase_ct
14 $db= sybase_connect_ex();
16 echo 'Nonexistant: '; sybase_set_messagehandler_ex('function_does_not_exist');
17 echo 'Static method: '; sybase_set_messagehandler_ex(array('sybase', 'static_handler'));
18 echo 'Instance method: '; sybase_set_messagehandler_ex(array(new sybase(), 'handler'));
19 echo 'Lambda function: '; sybase_set_messagehandler_ex(create_function('', 'return FALSE;'));
20 echo 'Unset: '; sybase_set_messagehandler_ex(NULL);
21 echo 'Incorrect type: '; sybase_set_messagehandler_ex(1);
22 echo 'Function: '; sybase_set_messagehandler_ex('sybase_msg_handler');
24 var_dump(sybase_select_ex($db, 'select getdate(NULL)'));
29 Warning: sybase_set_message_handler() expects parameter 1 to be a valid callback, function 'function_does_not_exist' not found or invalid function name in %stest.inc on line %d
31 Static method: bool(true)
32 Instance method: bool(true)
33 Lambda function: bool(true)
36 Warning: sybase_set_message_handler() expects parameter 1 to be a valid callback, no array or string given in %stest.inc on line %d
39 >>> Query: select getdate(NULL)
40 *** Caught Sybase Server Message #%d [Severity %d, state %d] at line %d