php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #75233 want a new opperator ?=
Submitted: 2017-09-20 13:32 UTC Modified: 2017-09-20 17:32 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:0 of 1 (0.0%)
From: uukoo at 163 dot com Assigned: cmb (profile)
Status: Closed Package: *General Issues
PHP Version: 7.2.0RC2 OS:
Private report: No CVE-ID: None
 [2017-09-20 13:32 UTC] uukoo at 163 dot com
Description:
------------
what we have
$a?:$b ==== $a?$a:$b
$a??$b ==== isset($a)?$a:$b

what we want
$a?=$b ==== isset($a)?$a:($a=$b)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-20 16:05 UTC] cmb@php.net
-Package: PHP Language Specification +Package: *General Issues
 [2017-09-20 17:32 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2017-09-20 17:32 UTC] cmb@php.net
A respective RFC for implementing an null coalesce operator (??=)[1] has already
been accepted, but nobody found the time to implement that feature, yet. A pull
request would be welcome!

[1] <https://wiki.php.net/rfc/null_coalesce_equal_operator>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC