|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-02-02 18:25 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2017-02-02 18:25 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
Description: ------------ Could you make 2 new combined operators: `$a ?= 4` => `$a = $a ?: 4` AND `$a ??= 4` => `$a = $a ?? 4` Test script: --------------- <?php function ofstr($a = NULL, $b = NULL) { $a ?= 1; $b ?= 100; return "$a of $b"; } print_r( array( ofstr(2, 5), ofstr(60), ofstr(FALSE, 5) ) ); Expected result: ---------------- Array ( [0] => 2 of 5 [1] => 60 of 100 [2] => 1 of 5 )