summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests/common.inc
blob: d4d1d9a4956c73430672c494a1d05de936335e15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*
 * Common definition and Settings
 */

// Custom Error Hanlder for testing
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
	global $debug;
	
	$err_type = array (
				1	=> "Error",			// E_ERROR
				2	=> "Warning",			// E_WARINING
				4	=> "Parsing Error",	// E_PARSE
				8	=> "Notice",			// E_NOTICE
				16	=> "Core Error",		// E_CORE_ERROR
				32	=> "Core Warning",		// E_CORE_WARNING
				64	=> "Compile Error",	// E_COMPILE_ERROR
				128 => "Compile Warning",	// E_COMPILE_WARNING
				256 => "User Error",		// E_USER_ERROR
				512 => "User Warning",		// E_USER_WARMING
				1024=> "User Notice"		// E_USER_NOTICE
				);
	
	if (!empty($debug)) {
		printf("%s: %s (%d)\n", $err_type[$err_no], $err_msg, $linenum);
	}
	else {
		printf("ERR: %s\n",$err_type[$err_no]);
	}
}

set_error_handler('test_error_handler');


// Var def for testing
$t_ary = array(
		's1' => '日本語EUC-JPの文字列',
		's2' => 'English Text'
		);

class tc
{
	var $s1 = '日本語EUC-JPの文字列';
	var $s2 = 'English Text';

	function tc() 
	{
	}
}

$t_obj = new tc;

?>