Re: [RFC] Destructuring Coalesce

From: Date: Sun, 16 Oct 2022 21:56:09 +0000
Subject: Re: [RFC] Destructuring Coalesce
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-118830@lists.php.net to get a copy of this message
I like it! But what should happen if: [ $a ?? '123', $b ] = []; [ $a ?? '123', $b ] = [ 1 ]; [ $a ?? '123', $b ] = [ 1, 2 ]; It also supports ?: operator? [ $a ?: '123' ] = []; so $a = '123' [ $a ?: '123' ] = [ false ]; so $a = '123' [ $a ?: '123' ] = [ 456 ]; so $a = 456 Atenciosamente, David Rodrigues

« previous php.internals (#118830) next »