note 104456 added to language.operators.comparison

From: Date: Thu, 16 Jun 2011 09:20:06 +0000
Subject: note 104456 added to language.operators.comparison
Groups: php.notes 
Request: Send a blank email to php-notes+get-180596@lists.php.net to get a copy of this message
The use of 5.3’s shortened ternary operator allows PHP to coalesce a null or empty value to an alternative: $value = $planA ?: $planB; My own server doesn’t yet run 5.3. A nice alternative is to use the “or” operator: $value = $planA or $value = planB; ---- Server IP: 69.147.83.197 Probable Submitter: 27.32.215.64 ---- Manual Page -- http://www.php.net/manual/en/language.operators.comparison.php Edit -- https://master.php.net/note/edit/104456 Del: integrated -- https://master.php.net/note/delete/104456/integrated Del: useless -- https://master.php.net/note/delete/104456/useless Del: bad code -- https://master.php.net/note/delete/104456/bad+code Del: spam -- https://master.php.net/note/delete/104456/spam Del: non-english -- https://master.php.net/note/delete/104456/non-english Del: in docs -- https://master.php.net/note/delete/104456/in+docs Del: other reasons-- https://master.php.net/note/delete/104456 Reject -- https://master.php.net/note/reject/104456 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180596) next »