Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<?php $x = ? if ($x == "1") print "1"; if ($x == "2") print "2"; if ($x == "3") print "3"; ?>
出力を印刷する$xは何"123"ですか?
"123"
$x値を一度だけ割り当てることができます。
$x = true
解決策:常に使用します===。==どうしても必要なケースは見たことがありません。
===
==
これをインスペクション ルールとして IDE に追加します。