Skip to content

Instantly share code, notes, and snippets.

@PallCreaker
Created December 4, 2013 09:54
Show Gist options
  • Save PallCreaker/7785033 to your computer and use it in GitHub Desktop.
Save PallCreaker/7785033 to your computer and use it in GitHub Desktop.
ハマったので、メモ。  return ( (ture) || (false) ) なら エラーが出そうだけど出ない。 これは tureになる。
<?php
function foo(){
$a = array("test"=>array("a","b"));
return(
empty($a['test']) || !in_array("c", $a["test"]) //=>ture
// empty($a['test']) //=>false
// !in_array("c", $a["test"]) //=>ture
);
}
echo $hoge = foo() ? "ture":"false";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment