error_reporting
配置错误信息回报的等级。语法: int error_reporting(int [level]);返回值: 整数函数种类: PHP 系统功能 

解决方案 »

  1.   

    用来设定错误讯息回报的等级,参数 level 是一个整数的位元遮罩 (bitmask),见下表。遮罩值 表示名称 
    1 E_ERROR 
    2 E_WARNING 
    4 E_PARSE 
    8 E_NOTICE 
    16 E_CORE_ERROR 
    32 E_CORE_WARNING E_NOTICE 表示一般情形不记录,只有程式有错误情形时才用到,例如企图存取一个不存在的变数,或是呼叫 stat() 函式检视不存在的档案。 
    E_WARNING 通常都会显示出来,但不会中断程式的执行。这对除错很有效。例如:用有问题的常规表示法呼叫 ereg()。 
    E_ERROR 通常会显示出来,亦会中断程式执行。意即用这个遮罩无法追查到记忆体配置或其它的错误。 
    E_PARSE 从语法中剖析错误。 
    E_CORE_ERROR 类似 E_ERROR,但不包括 PHP 核心造成的错误。 
    E_CORE_WARNING 类似 E_WARNING,但不包括 PHP 核心错误警告。 --------------------------------------------------------------------------------
      

  2.   

    设置当前脚本错误提示的相关设置上面是应该是关闭php编译错误提示。就是有编译错误,也不会在页面中提示
      

  3.   

    下面是代码对应的设置项
    1 E_ERROR  
    2 E_WARNING  
    4 E_PARSE  
    8 E_NOTICE  
    16 E_CORE_ERROR  
    32 E_CORE_WARNING  
    64 E_COMPILE_ERROR  
    128 E_COMPILE_WARNING  
    256 E_USER_ERROR  
    512 E_USER_WARNING  下面是上面设置项表示的意思:
    ; E_ALL             - All errors and warnings
    ; E_ERROR           - fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it's automatically initialized to an
    ;                     empty string)
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ;
      

  4.   

    结帖了,我还要补充,因为上面不全面:0代表E_Allerror_reporting(0)关闭所有错误和警告