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=> "Recoverable fatal error", // E_RECOVERABLE_ERROR 24 8192=> "Deprecated", // E_DEPRECATED 25 ); 26 27 if (!empty($debug)) { 28 printf("%s: %s (%d)\n", $err_type[$err_no], $err_msg, $linenum); 29 } 30 else { 31 printf("ERR: %s\n",$err_type[$err_no]); 32 } 33} 34 35set_error_handler('test_error_handler'); 36 37 38// Var def for testing 39$t_ary = array( 40 's1' => '���ܸ�EUC-JP��ʸ����', 41 's2' => 'English Text' 42 ); 43 44class tc 45{ 46 public $s1 = '���ܸ�EUC-JP��ʸ����'; 47 public $s2 = 'English Text'; 48 49 function __construct() 50 { 51 } 52} 53 54$t_obj = new tc; 55 56?> 57