common.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /*
  3. * Common definition and Settings
  4. */
  5. // Custom Error Hanlder for testing
  6. function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
  7. global $debug;
  8. $err_type = array (
  9. 1 => "Error", // E_ERROR
  10. 2 => "Warning", // E_WARINING
  11. 4 => "Parsing Error", // E_PARSE
  12. 8 => "Notice", // E_NOTICE
  13. 16 => "Core Error", // E_CORE_ERROR
  14. 32 => "Core Warning", // E_CORE_WARNING
  15. 64 => "Compile Error", // E_COMPILE_ERROR
  16. 128 => "Compile Warning", // E_COMPILE_WARNING
  17. 256 => "User Error", // E_USER_ERROR
  18. 512 => "User Warning", // E_USER_WARMING
  19. 1024=> "User Notice", // E_USER_NOTICE
  20. 2048=> "Strict Notice", // E_STRICT
  21. 4096=> "Recoverable fatal error", // E_RECOVERABLE_ERROR
  22. 8192=> "Deprecated", // E_DEPRECATED
  23. );
  24. if (!empty($debug)) {
  25. printf("%s: %s (%d)\n", $err_type[$err_no], $err_msg, $linenum);
  26. }
  27. else {
  28. printf("ERR: %s\n",$err_type[$err_no]);
  29. }
  30. }
  31. set_error_handler('test_error_handler');
  32. // Var def for testing
  33. $t_ary = array(
  34. 's1' => '日本語EUC-JPの文字列',
  35. 's2' => 'English Text'
  36. );
  37. class tc
  38. {
  39. public $s1 = '日本語EUC-JPの文字列';
  40. public $s2 = 'English Text';
  41. function __construct()
  42. {
  43. }
  44. }
  45. $t_obj = new tc;
  46. ?>