xref: /PHP-7.1/Zend/tests/bug46196.phpt (revision 7af945e2)
1--TEST--
2Test restore_error_handler() function : bug #46196
3--CREDITS--
4Olivier Doucet
5--FILE--
6<?php
7/* Prototype  : void restore_error_handler(void)
8 * Description: Restores the previously defined error handler function
9 * Source code: Zend/zend_builtin_functions.c
10 * Alias to functions:
11 */
12
13echo "*** Testing restore_error_handler() : error bug #46196 ***\n";
14
15var_dump( set_error_handler( 'myErrorHandler' ) );
16var_dump( restore_error_handler() );
17var_dump( set_error_handler( 'myErrorHandler' ) );
18
19function myErrorHandler($errno, $errstr, $errfile, $errline)
20{
21    return true;
22}
23
24?>
25===DONE===
26--EXPECTF--
27*** Testing restore_error_handler() : error bug #46196 ***
28NULL
29bool(true)
30NULL
31===DONE===
32