Skip to content

Instantly share code, notes, and snippets.

@hisui
Created August 8, 2012 04:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisui/3292019 to your computer and use it in GitHub Desktop.
Save hisui/3292019 to your computer and use it in GitHub Desktop.
マジか
function id($msg, $val)
{
echo "call:$msg", PHP_EOL;
return $val;
}
$ret =
id("A", true) ? id("A'", "a") :
id("B", false) ? id("B'", "b") : id("C", "c") ;
echo $ret, PHP_EOL;
# --- RESULT ---
#
# call:A
# call:A'
# call:B'
# b
#
@takeshik
Copy link

takeshik commented Nov 7, 2012

おそらく、この残念仕様 によるものですよね…実に酷い罠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment