rfc:isset-set-operator
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:isset-set-operator [2013/11/30 16:10] – chrislondon | rfc:isset-set-operator [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
* Date: 2013-11-24 | * Date: 2013-11-24 | ||
* Author: Chris London, me chrislondon co | * Author: Chris London, me chrislondon co | ||
- | * Status: Draft | + | * Status: Draft (Inactive) |
===== Introduction ===== | ===== Introduction ===== | ||
Line 24: | Line 24: | ||
??: will be equivalent to the ternary short hand ?: except that it also checks for isset(). | ??: will be equivalent to the ternary short hand ?: except that it also checks for isset(). | ||
- | | + | |
| | ||
- | // which is functionally equivalent to: | + | |
+ | |||
+ | $foo = $bar ??: ' | ||
+ | |||
+ | // ??: is functionally equivalent to: | ||
$foo = (isset($bar) && $foo) ? $bar : $other; | $foo = (isset($bar) && $foo) ? $bar : $other; | ||
| | ||
- | This will be very helpful echoing default variables in HTML like so: | + | This will be very helpful |
<div class="<? | <div class="<? | ||
Line 47: | Line 51: | ||
===== Open Issues ===== | ===== Open Issues ===== | ||
- | To be added | + | **Possible Alternatives |
+ | |||
+ | - ?:= | ||
+ | - ||= | ||
+ | - @= | ||
+ | |||
+ | **Possible Alternatives To ??: Operator** | ||
+ | |||
+ | - ?:: | ||
+ | - ?: (backward compatibility concerns) | ||
+ | - || (backward compatibility concerns) | ||
+ | - @: | ||
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== |
rfc/isset-set-operator.1385827810.txt.gz · Last modified: 2017/09/22 13:28 (external edit)