Returning references

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abhighat4214
    New Member
    • Jul 2008
    • 13

    Returning references

    function &$foo ()
    {
    $stringVal = "temp";
    return $stringVal;
    }

    $value = $foo() = "some new value";

    This is triggering an error called, "Cannot use function in write context". Actually speaking it should work because we're returning a reference. Am I missing something here ? Please guide me.

    Best Regards,
    Abhijit
    P.S. I find this forum very happening, no matter how silly my questions are they are always answered :)
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    What are you trying to do? You can't have 3 values equal to each other in one line, it is not true logic. Atleast from all the logic I know. Let us know what you are trying to do.

    Comment

    Working...