Forum Moderators: coopster

Message Too Old, No Replies

What does '->' and '=>' and 'GPC['variable']' mean?

         

SEOViking

8:30 pm on Sep 29, 2005 (gmt 0)

10+ Year Member



Can anybody point me to php documentation explaining these types of operators (?) in detail?

and what does the '~' mean in:
error_reporting(E_ALL & ~E_NOTICE)
? (or what does this whole sentence actually mean?

Netizen

9:42 pm on Sep 29, 2005 (gmt 0)

10+ Year Member



Take a look at the operators [uk.php.net] manual page and
look in the online manual for an explanation of E_ALL && ~E_NOTICE [php.net].

GPC usually refers to GET, POST and COOKIE variables.

ergophobe

5:22 pm on Sep 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Actually, those are not comparison operators, so the page Netizen gave won't help that much. To understand what -> and => do you need to read up on classes [uk.php.net] and arrays [uk.php.net], respectively.

-> is used to access an object member (method or property) as in

$x = new CustClass();

echo $x->name;

=> is used to assign an array value to an associative index

$x = array('a'=>1, 'b'=>2);

coopster

7:49 pm on Sep 30, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Actually, ergo, I think Netizen was referring to the textual message in the post as opposed to the thread title. Seems two separate areas of explanation were requested here -- Netizen nailed the question in the text of message number 1 and you covered the title question ;)

SEOViking, did I get that right? Are you asking for clarification on both areas?

SEOViking

5:22 am on Oct 1, 2005 (gmt 0)

10+ Year Member



Ergo, thanks for the direct explanation =) and Netizen, thanks for the link to the operators page. Still haven't figured out what the '~' means in the logging parameter...

henry0

10:47 am on Oct 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As per Zend
Set the error reporting level. The parameter is either an integer representing a bit field, or named constants. The error_reporting levels and constants are described in Predefined Constants, and in php.ini. To set at runtime, use the error_reporting() function. See also the display_errors directive.

In PHP 4 and PHP 5 the default value is E_ALL & ~E_NOTICE. This setting does not show E_NOTICE level errors. You may want to show them during development.

Note: Enabling E_NOTICE during development has some benefits. For debugging purposes: NOTICE messages will warn you about possible bugs in your code. For example, use of unassigned values is warned. It is extremely useful to find typos and to save time for debugging. NOTICE messages will warn you about bad style. For example, $arr[item] is better to be written as $arr['item'] since PHP tries to treat "item" as constant. If it is not a constant, PHP assumes it is a string index for the array.

Note: In PHP 5 a new error level E_STRICT is available. As E_STRICT is not included within E_ALL you have to explicitly enable this kind of error level. Enabling E_STRICT during development has some benefits. STRICT messages will help you to use the latest and greatest suggested method of coding, for example warn you about using deprecated functions.

coopster

11:16 pm on Oct 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member




Still haven't figured out what the '~' means in the logging parameter...

~ is the bitwise NOT operator. The link Netizen threw down there regarding operators will have a section titled Bitwise Operators [php.net].