xref: /PHP-5.3/ext/mbstring/tests/common.inc (revision 70c643f5)
1<?php
2/*
3 * Common definition and Settings
4 */
5
6// Custom Error Hanlder for testing
7function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
8	global $debug;
9
10	$err_type = array (
11				1	=> "Error",			// E_ERROR
12				2	=> "Warning",			// E_WARINING
13				4	=> "Parsing Error",	// E_PARSE
14				8	=> "Notice",			// E_NOTICE
15				16	=> "Core Error",		// E_CORE_ERROR
16				32	=> "Core Warning",		// E_CORE_WARNING
17				64	=> "Compile Error",	// E_COMPILE_ERROR
18				128 => "Compile Warning",	// E_COMPILE_WARNING
19				256 => "User Error",		// E_USER_ERROR
20				512 => "User Warning",		// E_USER_WARMING
21				1024=> "User Notice",		// E_USER_NOTICE
22				2048=> "Strict Notice",      // E_STRICT
23				4096=> "Catchable fatal error",      // E_RECOVERABLE_ERROR
24				);
25
26	if (!empty($debug)) {
27		printf("%s: %s (%d)\n", $err_type[$err_no], $err_msg, $linenum);
28	}
29	else {
30		printf("ERR: %s\n",$err_type[$err_no]);
31	}
32}
33
34set_error_handler('test_error_handler');
35
36
37// Var def for testing
38$t_ary = array(
39		's1' => '���ܸ�EUC-JP��ʸ����',
40		's2' => 'English Text'
41		);
42
43class tc
44{
45	public $s1 = '���ܸ�EUC-JP��ʸ����';
46	public $s2 = 'English Text';
47
48	function tc()
49	{
50	}
51}
52
53$t_obj = new tc;
54
55?>
56