Can I do the following?

function foo(&$a)
{
    $a += 2;
}

foo($bar = 5);

// Desired Outcome:
// $bar = 7

In other words, can I pass an assignment by reference and have the desired outcome? (Yes, I know that I could do the test myself, but I'm working on something at the moment and it's actually quicker to ask here.)

Nevermind. I got my answer.

A PHP Error was encountered

Severity: Runtime Notice

Message: Only variables should be passed by reference
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.