English 中文(简体)
差错报告水平的数值
原标题:Numeric values of error reporting levels
  • 时间:2010-09-21 08:12:24
  •  标签:
  • php

I m 检查我的PHP服务器的配置,我需要确定以下参数:

差错:报告顺序为E_ALL &~E_NOTICE

然而,在我的服务器上,数字价值是:

错误

我想知道它的含义是什么,我是否真的需要改变它。

感谢

最佳回答
问题回答

错误的旗帜是2个编造者的力量,以便你能够使用借方操作者将其合并起来。 结果是,如果你把它交给E_ALL &,那么就象你看到的那种愤怒。 哪些旗帜构成6135项价值,取决于您的php版本。 如果使用双向和操作者(例如)在其内部控制国旗,你可以检查。

if ((error_reporting() & E_NOTICE) == E_NOTICE) {
    echo "E_NOTICE is active";
}
foreach(
    array( E_ALL ,  E_NOTICE ,  ~E_NOTICE ,  E_ALL&~E_NOTICE ) 
    as $s) {
    eval("$v=$s;");
    printf("%20s = dec %10u = bin %32b
", $s, $v, $v);
}

结果

           E_ALL = dec       6143 = bin                    1011111111111
        E_NOTICE = dec          8 = bin                             1000
       ~E_NOTICE = dec 4294967287 = bin 11111111111111111111111111110111
 E_ALL&~E_NOTICE = dec       6135 = bin                    1011111110111

注:error_ reporting(-1);将报告所有和任何购买力平价错误。

错误——6135次报告不会记录停留时间通知,因此能够更好地使用。

error_reporting(E_ALL);

之后

ini_set( display_errors ,  0 );

这将记录所有错误,包括长时通知,但浏览器显示的通风。 可在任何PHP版本中使用。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...