PHP assignment with a default value

前端 未结 5 2118
春和景丽
春和景丽 2021-02-20 01:48

What\'s a nicer way to do the following, that doesn\'t call f() twice?

$x = f() ? f() : \'default\';
5条回答
提交回复
热议问题