Re: Ternary operator performance improvements
| From: | Stas Malyshev | Date: | Tue, 18 Oct 2011 21:47:43 +0000 |
| Subject: | Re: Ternary operator performance improvements | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-55865@lists.php.net to get a copy of this message | ||
Hi!
On 10/18/11 2:43 PM, Alain Williams wrote:
It probably does, but it is quite subtle. I was expecting the above to work since it does in C -- although in C&variable is an address which can be used in an expression ... the PHP '&' operator is different, in spite of apparent similarities.Actually, in PHP standalone & doesn't even make any sense. PHP has certain operations - assignment by reference (bind two names to one variable) and passing by reference (which is the same thing but cross-scope) and returning by reference (which again is the same thing but in opposite direction). But unlike C there's no operation "taking reference" because while C has pointers PHP doesn't have anything like that. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227