note 17728 deleted from language.operators.execution by jimw

From: Date: Fri, 21 Dec 2001 07:19:15 +0000
Subject: note 17728 deleted from language.operators.execution by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23734@lists.php.net to get a copy of this message
What they're saying is that when you've got an expression which uses more than one operator (i.e. the plus sign, minus sign, etc), then you look up the table to find out which ones get priority. It's probably useful to be thought of as "Operator Importance" or "Operator Priority". For example, lets say you have the following expression : $foo = 10 + 2 * 8. $foo here equals 26, coz it gets calculated like this : a) PHP notices it has to choose from either doing the 10+2 bit first, or the 2*8 bit first. It doesn't do it from left to right as some people assume. b) PHP looks up the table, and * has a higher priority than +, so it does the 2*8 bit first, and gets 16. Now the expression looks like this : $foo = 10 + (2 * 8) $foo = 10 + 16 c) PHP finishes evaluating the expression, and stuffs the result into $foo $foo = 16. Hope that helps.

« previous php.notes (#23734) next »