error_reporting() ´íÎ󼶱ðÏê½â
ÔÚPHP¿ª·¢µÄʱºò³£³£»áÓõ½error_reporting(report_level)À´µ÷ÊÔ×Ô¼ºµÄ³ÌÐò¡£ÏÂÃæÁгöÁËreport_level¿ÉÄÜÖµ
Öµ | ³£Á¿ | ÃèÊö |
---|---|---|
1 | E_ERROR | ÕâÊÇÒ»¸öÑÏÖØ´íÎ󣬲»¿É»Ö¸´£¬ÈçλÖÃÒì³££¬ÄÚ´æ²»×ãµÈ |
2 | E_WARNING | ¾¯¸æ£¬×îÒ»°ãµÄ´íÎó£¬È纯ÊýµÄ²ÎÊý´íÎóµÈ |
4 | E_PARSE | ½âÎö´íÎó£¬ÔÚ½âÎöPHPÎļþʱ²úÉú£¬²¢Ç¿ÖÆPHPÔÚÖ´ÐÐÇ°Í˳ö |
8 | E_NOTICE | ͨ¸æ±íʾ¿ÉÄÜÔÚ²Ù×÷һЩδ֪µÄ±äÁ¿µÈ¡£ÔÚ¿ª·¢Ê±¿É¿ªÆôͨ¸æ£¬ÒÔ±£Ö¤³ÌÐòÊÇ"°²È«Í¨¸æ"µÄ£¬ÈðÔÚÕýʽϵͳÖУ¬Ó¦¹Ø±Õͨ¸æ |
16 | E_CORE_ERROR | Õâ¸öÄÚ²¿´íÎóÊÇÓÉÓÚPHP¼ÓÔØÀ©Õ¹Ê§°Ü¶øµ¼Öµģ¬²¢ÇһᵼÖÂPHPÍ£Ö¹ÔËÐв¢Í˳ö |
32 | E_CORE_WARNING | PHPÆô¶¯Ê±³õʼ»¯¹ý³ÌÖеľ¯¸æ(·ÇÖÂÃüÐÔ´í) |
64 | E_COMPILE_ERROR | ±àÒë´íÎóÊÇÔÚ±àÒëʱ·¢Éú£¬Õâ¸ö´íÎ󽫵¼ÖÂPHPÔËÐÐÍ˳ö |
128 | E_COMPILE_WARNING | ±àÒ뾯¸æÓÃÓÚ¸æËßÓû§Ò»Ð©²»ÍƼöµÄÓï·¨ÐÅÏ¢ |
256 | E_USER_ERROR | Óû§¶¨ÒåµÄ´íÎ󽫵¼Ö´ÇPHPÍ˳ö£¬Ëü¶ÔÊÇÀ´×ÔPHP×ÔÉí£¬¶øÊÇÀ´×Խű¾ÎļþÖС£ |
512 | E_USER_WARNING | ½Å±¾Ê¹ÓÃËüÀ´Í¨ÖªÒ»¸öÖ´ÐÐʧ°Ü£¬Í¬Ê±PHPÒ²»áÓÃE_WARNING֪ͨ |
1024 | E_USER_NOTICE | Óû§¶¨ÒåµÄͨ¸æÓÃÓÚÔڽű¾Öбíʾ¿ÉÄÜ´æÔڵĴíÎó |
2048 | E_STRICT | ±àÂë±ê×¼»¯¾¯¸æ(½¨ÒéÈçºÎÐÞ¸ÄÒÔÏòÇ°¼æÈÝ) |
4096 | E_RECOVERABLE_ERROR | ½Ó½üÖÂÃüµÄÔËÐÐʱ´íÎó£¬Èôδ±»²¶»ñÔòÊÓͬE_ERROR |
8191 | E_ALL | ³ýE_STRICTÍâµÄËùÓдíÎó(PHP6ÖÐΪ8191,¼´°üº¬ËùÓÐ) |
Àý×Ó£º
ÈÎÒâÊýÄ¿µÄÒÔÉÏÑ¡Ï¿ÉÒÔÓá°»ò¡±À´Á¬½Ó£¨Óà OR »ò
|£©£¬ÕâÑù¿ÉÒÔ±¨¸æËùÓÐÐèÒªµÄ¸÷¼¶±ð´íÎó¡£ÀýÈ磬ÏÂÃæµÄ´úÂë¹Ø±ÕÁËÓû§×Ô¶¨ÒåµÄ´íÎóºÍ¾¯¸æ£¬Ö´ÐÐÁËijЩ²Ù×÷£¬È»ºó»Ö¸´µ½ÔʼµÄ±¨´í¼¶±ð£º
<?php //½ûÓôíÎ󱨸æ error_reporting(0); //±¨¸æÔËÐÐʱ´íÎó error_reporting(E_ERROR | E_WARNING | E_PARSE); //±¨¸æËùÓдíÎó error_reporting(E_ALL); error_reporting(7); ÉèÖÃphp´íÎó¼ì²â¼¶±ð E_ERROR - ÖÂÃüÐÔÔËÐÐʱ´í (1) E_WARNING - ÔËÐÐʱ¾¯¸æ£¨·ÇÖÂÃüÐÔ´í£©(2) E_PARSE - ±àÒëʱ½âÎö´íÎó (4) 1+2+4 = 7 ?>
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ