Re: PHP7 Coalesce operator

From: Date: Sun, 22 Nov 2015 20:41:59 +0000
Subject: Re: PHP7 Coalesce operator
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-89295@lists.php.net to get a copy of this message
Hi, shadda wrote:
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.
This is not strictly correct. Though something of a misnomer, the 'null coalesce operator' checks if a variable doesn't exist, but also that it is not null, i.e. it functions like isset(). Thanks. -- Andrea Faulds http://ajf.me/

« previous php.internals (#89295) next »