Back to index

php5  5.3.10
common.inc
Go to the documentation of this file.
00001 <?php
00002 /*
00003  * Common definition and Settings
00004  */
00005 
00006 // Custom Error Hanlder for testing
00007 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
00008        global $debug;
00009        
00010        $err_type = array (
00011                             1      => "Error",                 // E_ERROR
00012                             2      => "Warning",               // E_WARINING
00013                             4      => "Parsing Error",  // E_PARSE
00014                             8      => "Notice",                // E_NOTICE
00015                             16     => "Core Error",            // E_CORE_ERROR
00016                             32     => "Core Warning",          // E_CORE_WARNING
00017                             64     => "Compile Error",  // E_COMPILE_ERROR
00018                             128 => "Compile Warning",   // E_COMPILE_WARNING
00019                             256 => "User Error",        // E_USER_ERROR
00020                             512 => "User Warning",             // E_USER_WARMING
00021                             1024=> "User Notice",              // E_USER_NOTICE
00022                             2048=> "Strict Notice",      // E_STRICT
00023                             4096=> "Catchable fatal error",      // E_RECOVERABLE_ERROR
00024                             );
00025        
00026        if (!empty($debug)) {
00027               printf("%s: %s (%d)\n", $err_type[$err_no], $err_msg, $linenum);
00028        }
00029        else {
00030               printf("ERR: %s\n",$err_type[$err_no]);
00031        }
00032 }
00033 
00034 set_error_handler('test_error_handler');
00035 
00036 
00037 // Var def for testing
00038 $t_ary = array(
00039               's1' => '日本語EUC-JPの文字列',
00040               's2' => 'English Text'
00041               );
00042 
00043 class tc
00044 {
00045        public $s1 = '日本語EUC-JPの文字列';
00046        public $s2 = 'English Text';
00047 
00048        function tc() 
00049        {
00050        }
00051 }
00052 
00053 $t_obj = new tc;
00054 
00055 ?>