What is the difference between & and ?
Posted: Wed Dec 12, 2007 9:12 pm
Hi
What is the difference between & and ? in PHP
What is the difference between & and ? in PHP
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$foo = &$bar; // foo is now a reference to $bar, not a copy.
$foo & $bar; // $foo and $bar are compared in binary. The bits shared between them are returned.
$foo && $bar; // $foo and $bar are compared logically. If $foo is true and $bar is true, true is returned. All else returns false.
$foo ? $bar : $baf; // If $foo is true, $bar is returned, otherwise $baf is returned.