Hey all. Been a while since I popped into this list. You may remember me from 
such emails as “Why god can’t we have namespaces”, or “so we’re still not 
fixing strpos, eh?”

I had a question-suggestion based around the cool new operator we’re getting in 
PHP7, the ?? operator, which as I understand it is the functional equivalent to 
perl’s // operator; in that they both test for whether or not a variable is 
defined, rather than it’s truthiness. 

That’s all well and good, but one of the things that makes the || operator in 
javascript so handy is that definedness and truthiness go hand in hand, and an 
undefined value will simply evaluate to null/false, making things like (foo || 
false || true) possible, which is quite handy in a lot of situations. It seems 
like if we already have a construct in place that’ll bypass raising an 
E_NOTICE, it should possible to implement a secondary operator that tests for 
truthiness with similar semantics.

Something like, $config->auto_play = $config->auto_play ?! $defaults->auto_play 
?! false;

Do you feel me? Guys?

-M
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to