Good evening,
I’ve put the Null Coalesce Operator RFC to a vote:
https://wiki.php.net/rfc/isset_ternary#vote
It is a 2/3 majority vote and ends in a week’s time on 2014-09-27.
For anyone wondering, I’ve decided not to include ??= because we don’t have an assignment operator for ?: either, nor does C# have one, it may be a pain to implement, and I’m not sure we need it.
Thanks!
Andrea Faulds
http://ajf.me/
Am 20.09.2014 01:35 schrieb "Andrea Faulds" ajf@ajf.me:
Hi,
got a question after being bitten my the issue yesterday in the context of
the "@yadda ?: 'default'" form yesterday:
What about yadda that results, at the moment, in fatal errors?? Things like
static::$missingproperty, $this->missingmethod(), and other stuff?
Will the ?? operator
A) make these non-fatal
B) silently fatal (like now when @ is used)
C) loudly fatal (like when no @ is used)
D) depends on what fatal it is?
To me the most annoying case here, not only in relation to ?? of course, is
the different behaviour of $this->missingproperty and
someclass::$missingproperty, with the latter being fatal, but easily
provocable by a call to unset(someclass::$missingproperty earlier in the
code.
best regards
Patrick
Am 20.09.2014 01:35 schrieb "Andrea Faulds" ajf@ajf.me:
Hi,
got a question after being bitten my the issue yesterday in the context of
the "@yadda ?: 'default'" form yesterday:What about yadda that results, at the moment, in fatal errors?? Things like
static::$missingproperty, $this->missingmethod(), and other stuff?Will the ?? operator
A) make these non-fatal
B) silently fatal (like now when @ is used)
C) loudly fatal (like when no @ is used)
D) depends on what fatal it is?
$this->missingmethod() ?? null will continue to be (loudly) fatal (or
recoverable fatal, once a recent RFC is merged).
static::$missingproperty ?? null will not throw an error, as it is subject
to isset().
To me the most annoying case here, not only in relation to ?? of course, is
the different behaviour of $this->missingproperty and
someclass::$missingproperty, with the latter being fatal, but easily
provocable by a call to unset(someclass::$missingproperty earlier in the
code.
It's not possible to unset a static property, see http://3v4l.org/PkD36.
Which is probably also why accessing an undefined static property is fatal
as well ;)
Nikita
Am 20.09.2014 01:35 schrieb "Andrea Faulds" ajf@ajf.me:
Hi,
got a question after being bitten my the issue yesterday in the context of
the "@yadda ?: 'default'" form yesterday:What about yadda that results, at the moment, in fatal errors?? Things like
static::$missingproperty, $this->missingmethod(), and other stuff?Will the ?? operator
A) make these non-fatal
B) silently fatal (like now when @ is used)
It should be this one to be consistent. @ is shit, but sadly can not be
avoided in all situations.
cheers,
Derick
looks like Perl magic :(
-1
Dmitry.
Am 20.09.2014 01:35 schrieb "Andrea Faulds" ajf@ajf.me:
Hi,
got a question after being bitten my the issue yesterday in the context
of
the "@yadda ?: 'default'" form yesterday:What about yadda that results, at the moment, in fatal errors?? Things
like
static::$missingproperty, $this->missingmethod(), and other stuff?Will the ?? operator
A) make these non-fatal
B) silently fatal (like now when @ is used)It should be this one to be consistent. @ is shit, but sadly can not be
avoided in all situations.cheers,
Derick
I’ve put the Null Coalesce Operator RFC to a vote:
https://wiki.php.net/rfc/isset_ternary#vote
It is a 2/3 majority vote and ends in a week’s time on 2014-09-27.
By 31 votes to 3, the RFC has passed and voting has now closed. If there are no objections, I'll merge the patch sometime soon and work on a specification patch.
Andrea Faulds
http://ajf.me/