Javascript では、次のコードでこれを行うことができます。
function test(a) {
a && (console.log("somthing"), executeOtherFunction());
}
上記のこのコードは、次の省略形です。
function test(a){
if(a){
console.log("something");
executeOtherFunction()
}
}
これをPHPで機能させることは可能ですか?
PHPで使うという意味ではなくconsole.log
、PHPでも同じものを使いたいだけです。