& operator

    Date: 08/30/06 (PHP Community)    Keywords: no keywords

    Hey everybody -

    I know what the & operator does - it makes a variable passed by reference. So when you do

    function (&$arg) {
        $arg = !$arg;
    }
    EDIT
    I think that's the worst function I've ever written. Try running it. Everything is null.

    pretend I did this instead:
    function foo(&$arg) {
        $arg++;
    }

    /EDIT

    $arg is changed to logical false incremented in the scope that you called the function from. I've seen this syntax a lot lately - and I'm trying to figure out what the meaning is:
    function & ($arg) {
        //statements
    }
    What does this to to the function? what does it do the the value of $arg?

    Thanks!


    ~d

    Source: http://community.livejournal.com/php/490217.html

« godaddy.com == useless || Hmm »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home