Re: what's the difference in the following code?

From: Date: Tue, 21 Oct 2008 09:44:32 +0000
Subject: Re: what's the difference in the following code?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-282177@lists.php.net to get a copy of this message
OP = original poster (in this case I guess) http://acronyms.thefreedictionary.com/OP So it's all about making code readable and probably easier to maintain (even people unfamiliar with the script). Doesn't that render the ternary operator IF-statement unnecessary? Have I been totally wrong using it in countless scripts of mine (always thought it's a neat way to do if )? Somebody please tell me that I do not have to rewrite my code base now, since I care about security. Btw. PHP's ternary inconsistency here .. http://en.wikipedia.org/wiki/%3F:#Inconsistency_of_implementations And how about this .. switch(isset($_GET['search'])) { case true: $search = $_GET['search']; break 1; default: $search = ''; }

« previous php.general (#282177) next »