Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103777 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77006 invoked from network); 22 Jan 2019 20:02:20 -0000 Received: from unknown (HELO mail-io1-f52.google.com) (209.85.166.52) by pb1.pair.com with SMTP; 22 Jan 2019 20:02:20 -0000 Received: by mail-io1-f52.google.com with SMTP id k7so19637045iob.6 for ; Tue, 22 Jan 2019 08:40:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7KTueBAIJ7BtNH2ZEZmZfuHRWwPqtPUUnozkohNjHIE=; b=C11KrNE7KwjRrxcZkwq/LRTXvXkZGcWTVp4jg2f391JIReCG4//iQv9miVGbvdCzHd FDA2k1BzLVoR6eTEhKHllhj8R4MihZs8jtmVgE43aT7aaLNcyiJ7WkYUzdmwcyYZkTLn VhZ7nKkEIiPW5X6m3T5QAVCn8y27GqXWr+ODQEev9shu6GvGZQYK5DmANpl3X+Qw/bIX yHdyawWGgYeTzVOU+b1tcNnWUYfXjXgCkEACUC7G6EY57YcykpGNf+xNmvmUB3bTGOn7 xp+Sz2EB50QLUetmILKkNZ9tGCi44ZEnssYhFQ10F8YEy/w3YYh86xJTGW7nBfIERkDj U3Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7KTueBAIJ7BtNH2ZEZmZfuHRWwPqtPUUnozkohNjHIE=; b=sAJF+RTgqGymR3c/UEpuQV+A9i885V8atvL7RxsVqtbgl0vH1Hxyp5/54lVGKX/hhQ 17Z5LSPawtsrkF7vfSdHz/rG+N+aN6+UVTm5vm5DYck5IFbAVbOcftuGtuEfJT11mh+o rFLKAXNia8yUps+sHbiSUzeAJ1IpzpxjNbg5VJ4XtsjRcKuJwd8DYosdrimBURkCBUPK L4b5euewOvifsKkKkD8BxMMNsBCRgMK4tcz9Z1hLS/mLE8lLeAOrNU0AYkKypTfJHFBp KSQlcFIOXbDuP6jF0pEzHxMHT8cqAPA+/uWt7PjiAnkgSQzoBKoIPoMw4Uq4HtuQwvct Kp3A== X-Gm-Message-State: AJcUukftIp4vxubcldvirNDrgdHHF/OP8lQIAuRuoTcw0BkoJAV1aL1h Sn//myRaMEyTJAfFR2eHwGcrM+xhDNBWwSEzGg4= X-Google-Smtp-Source: ALg8bN75mGtS3PHfVxTNnviVuh3273tAeyY3HsEakODLWUPuzVJfZ+ROLVsemUKxeuoDS2CRwVkvKiINHJ9drQU2okY= X-Received: by 2002:a5d:834e:: with SMTP id q14mr18559283ior.258.1548175200012; Tue, 22 Jan 2019 08:40:00 -0800 (PST) MIME-Version: 1.0 References: <35fd7cd8-ee18-7cc3-68ea-543429c1f6dc@telia.com> In-Reply-To: <35fd7cd8-ee18-7cc3-68ea-543429c1f6dc@telia.com> Date: Tue, 22 Jan 2019 17:39:44 +0100 Message-ID: To: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= Cc: Sara Golemon , PHP internals Content-Type: multipart/alternative; boundary="000000000000d8cf9c05800ea0d6" Subject: Re: [PHP-DEV] Coalesce assign operator (??=) implemented From: nikita.ppv@gmail.com (Nikita Popov) --000000000000d8cf9c05800ea0d6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 22, 2019 at 4:51 PM Bj=C3=B6rn Larsson wrote: > Hi, > > Excellent work! I have been waiting for this :) > > Sara, I came to think on the Short ternary Assignment Operator RFC. > Would this implementation make that one more feasible, given it > passes a vote? > From an implementation perspective ?:=3D is nearly identical to ??=3D, so implementing it should be quite simple now. Whether an RFC for it would pass is a different question, I'm not a big fan personally... Nikita > r//Bj=C3=B6rn Larsson > > Den 2019-01-22 kl. 11:33, skrev Nikita Popov: > > > Hi internals, > > > > Some time ago an RFC for the ??=3D operator has been accepted: > > https://wiki.php.net/rfc/null_coalesce_equal_operator > > > > However, due to implementation difficulties, the RFC hasn't landed sinc= e > > then. I'm happy to say that these difficulties are resolved now, and ??= =3D > > has landed with > > > https://github.com/php/php-src/commit/a50198d0fef652ca052cda642d6e98a9101= eb73f > > . > > > > To summarize the important ??=3D semantics: $a ??=3D $b is roughly equi= valent > > to $a ?? ($a =3D $b). In $a[foo()] ??=3D bar() the function foo() will = be > > evaluated exactly once, and bar() will be evaluated iff $a[foo()] is nu= ll > > (or unset). > > > > Regards, > > Nikita > > > --000000000000d8cf9c05800ea0d6--